From 4d3a7c62ddcab6abc5ca45e6cabc90258025a768 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Thu, 11 Jul 2019 15:52:27 -0400 Subject: [PATCH 1/1] Drop e2.mock.rannames feature This mocked a list of RAN names to support testing in R1. Remove because the latest e2mgr provides a list of names. Change-Id: I467c9ec33b53ea524ace97eab4c87c4f0bbbf6b9 Signed-off-by: Lott, Christopher (cl778h) --- docs/release-notes.rst | 3 ++- .../dashboard/controller/E2ManagerController.java | 22 ++-------------------- .../src/main/resources/application.properties | 3 --- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index c81ca59a..bb84273e 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -20,12 +20,13 @@ RIC Dashboard Release Notes =========================== -Version 1.2.0, 10 July 2019 +Version 1.2.0, 11 July 2019 --------------------------- * Split URL properties into prefix/suffix parts * Add jacoco plugin to back-end for code coverage * Compile with Java version 11, run with image openjdk:11 * Clean code of issues reported by Sonar +* Drop mock RAN names feature that supported R1 testing Version 1.0.5, 5 July 2019 -------------------------- diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java index ad75c88d..e2523982 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java @@ -29,7 +29,6 @@ import org.oransc.ric.e2mgr.client.api.HealthCheckApi; import org.oransc.ric.e2mgr.client.api.NodebApi; import org.oransc.ric.e2mgr.client.model.GetNodebResponse; import org.oransc.ric.e2mgr.client.model.NodebIdentity; -import org.oransc.ric.e2mgr.client.model.NodebIdentityGlobalNbId; import org.oransc.ric.e2mgr.client.model.SetupRequest; import org.oransc.ric.portal.dashboard.DashboardApplication; import org.oransc.ric.portal.dashboard.DashboardConstants; @@ -38,7 +37,6 @@ import org.oransc.ric.portal.dashboard.model.SuccessTransport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import org.springframework.util.Assert; @@ -58,9 +56,6 @@ import io.swagger.annotations.ApiOperation; * 502 on failure and wrap the remote details:
HTTP server received * an invalid response from a server it consulted when acting as a proxy or * gateway.
- * - * In R1 the E2 interface does not yet implement the get-ID-list method, so this - * class mocks up some functionality. */ @Configuration @RestController @@ -86,24 +81,12 @@ public class E2ManagerController { private final HealthCheckApi e2HealthCheckApi; private final NodebApi e2NodebApi; - // TODO: remove this when E2 delivers the feature - private final List mockNodebIdList; - @Autowired - public E2ManagerController(final HealthCheckApi e2HealthCheckApi, final NodebApi e2NodebApi, - @Value("${e2mgr.mock.rannames:#{null}}") final String mockRanNames) { + public E2ManagerController(final HealthCheckApi e2HealthCheckApi, final NodebApi e2NodebApi) { Assert.notNull(e2HealthCheckApi, "API must not be null"); Assert.notNull(e2NodebApi, "API must not be null"); this.e2HealthCheckApi = e2HealthCheckApi; this.e2NodebApi = e2NodebApi; - mockNodebIdList = new ArrayList<>(); - if (mockRanNames != null) { - logger.debug("ctor: Mocking RAN names: {}", mockRanNames); - for (String id : mockRanNames.split(",")) { - NodebIdentityGlobalNbId globalNbId = new NodebIdentityGlobalNbId().nbId("mockNbId").plmnId("mockPlmId"); - mockNodebIdList.add(new NodebIdentity().globalNbId(globalNbId).inventoryName(id.trim())); - } - } } @ApiOperation(value = "Gets the E2 manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class) @@ -125,8 +108,7 @@ public class E2ManagerController { @GetMapping(RAN_METHOD) public List getRanDetails() { logger.debug("getRanDetails"); - // TODO: remove mock when e2mgr delivers the getNodebIdList() method - List nodebIdList = mockNodebIdList.isEmpty() ? e2NodebApi.getNodebIdList() : mockNodebIdList; + List nodebIdList = e2NodebApi.getNodebIdList(); List details = new ArrayList<>(); for (NodebIdentity nbid : nodebIdList) { GetNodebResponse nbResp = null; diff --git a/webapp-backend/src/main/resources/application.properties b/webapp-backend/src/main/resources/application.properties index db5d5b09..382cd191 100644 --- a/webapp-backend/src/main/resources/application.properties +++ b/webapp-backend/src/main/resources/application.properties @@ -39,6 +39,3 @@ appmgr.url.suffix = /ric/v1 # E2 Manager e2mgr.url.prefix = http://jar-app-props-default-E2-URL e2mgr.url.suffix = /v1 -# Supply CSV to mock the get-list API for testing e2mgr in R1; -# missing key or empty value disables the mock behavior -# e2mgr.mock.rannames = RANONE, RANTWO -- 2.16.6