import java.util.List;
import java.util.Map;
+import org.oransc.ric.portal.dashboard.model.RicRegionList;
import org.oransc.ricplt.e2mgr.client.api.HealthCheckApi;
import org.oransc.ricplt.e2mgr.client.api.NodebApi;
import org.oransc.ricplt.e2mgr.client.invoker.ApiClient;
import org.oransc.ricplt.e2mgr.client.model.GetNodebResponse;
import org.oransc.ricplt.e2mgr.client.model.NodebIdentity;
-import org.oransc.ricplt.e2mgr.client.model.NodebIdentityGlobalNbId;
-import org.oransc.ricplt.e2mgr.client.model.ResetRequest;
+import org.oransc.ricplt.e2mgr.client.model.UpdateGnbRequest;
+import org.oransc.ricplt.e2mgr.client.model.UpdateGnbResponseGlobalNbId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
// Simulate remote method delay for UI testing
private int delayMs;
+ // Autowire all the properties required by the real class
+ // (even tho not used here) as a test of the properties.
@Autowired
- public E2ManagerMockConfiguration(@Value("${mock.config.delay:0}") int delayMs) {
- logger.debug("ctor: configured with delay {}", delayMs);
+ public E2ManagerMockConfiguration(@Value("${e2mgr.url.suffix}") final String urlSuffix, //
+ final RicRegionList instanceConfig, //
+ @Value("${mock.config.delay:0}") int delayMs) {
+ logger.info("ctor: configured with suffix {}, instances {}, delay {}", urlSuffix, instanceConfig, delayMs);
this.delayMs = delayMs;
}
*/
private NodebApi nodebApi(String instanceKey) {
- final NodebIdentityGlobalNbId globalNbId = new NodebIdentityGlobalNbId().nbId("mockNbId-" + instanceKey)
+ final UpdateGnbResponseGlobalNbId globalNbId = new UpdateGnbResponseGlobalNbId().nbId("mockNbId-" + instanceKey)
.plmnId("mockPlmId");
final List<NodebIdentity> nodebIdList = new ArrayList<>();
final Map<String, GetNodebResponse> nodebResponseMap = new HashMap<>();
// "globalNbId":null,"gnb":null,"ip":"10.2.0.6","nodeType":null,"port":36444,
// "ranName":"AAAA123456","setupFailure":null}}]
nodebIdList.add(new NodebIdentity().inventoryName(RAN_NAME_1).globalNbId(globalNbId));
- nodebResponseMap.put(RAN_NAME_1,
- new GetNodebResponse().connectionStatus("CONNECTING").ip("127.0.0.1").port(456).ranName(RAN_NAME_2).nodeType("ENDC").port(100));
+ nodebResponseMap.put(RAN_NAME_1, new GetNodebResponse().connectionStatus("CONNECTING").ip("127.0.0.1").port(456)
+ .ranName(RAN_NAME_2).nodeType("ENDC").port(100));
nodebIdList.add(new NodebIdentity().inventoryName(RAN_NAME_2).globalNbId(globalNbId));
- nodebResponseMap.put(RAN_NAME_2,
- new GetNodebResponse().connectionStatus("CONNECTED").ip("127.0.0.2").port(456).ranName(RAN_NAME_2).nodeType("X2").port(200));
+ nodebResponseMap.put(RAN_NAME_2, new GetNodebResponse().connectionStatus("CONNECTED").ip("127.0.0.2").port(456)
+ .ranName(RAN_NAME_2).nodeType("X2").port(200));
ApiClient apiClient = apiClient();
NodebApi mockApi = mock(NodebApi.class);
}).when(mockApi).nodebShutdownPut();
doAnswer(inv -> {
if (delayMs > 0) {
- logger.debug("reset sleeping {}", delayMs);
+ logger.debug("updateGnb sleeping {}", delayMs);
Thread.sleep(delayMs);
}
return null;
- }).when(mockApi).reset(any(String.class), any(ResetRequest.class));
+ }).when(mockApi).updateGnb(any(UpdateGnbRequest.class), any(String.class));
doAnswer(inv -> {
if (delayMs > 0) {
logger.debug("getNb sleeping {}", delayMs);