X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-backend%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fcontroller%2FE2ManagerControllerTest.java;h=328a5ad53a037898531eb9c1318832f61f133007;hb=329b53efb578dd41a6de31eafd5f228f3f10987c;hp=28de9da3e3d6adee952d3827918b759139dd3637;hpb=8b0c1aa1535896ad557d5d685a031208aa1b6dfb;p=portal%2Fric-dashboard.git diff --git a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java index 28de9da3..328a5ad5 100644 --- a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java +++ b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java @@ -23,9 +23,11 @@ import java.lang.invoke.MethodHandles; import java.net.URI; import java.util.List; -import org.junit.After; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; import org.oransc.ric.portal.dashboard.DashboardConstants; import org.oransc.ric.portal.dashboard.config.E2ManagerMockConfiguration; import org.oransc.ric.portal.dashboard.config.RICInstanceMockConfiguration; @@ -33,7 +35,7 @@ import org.oransc.ric.portal.dashboard.model.RanDetailsTransport; import org.oransc.ric.portal.dashboard.model.SuccessTransport; import org.oransc.ricplt.e2mgr.client.model.GetNodebResponse; import org.oransc.ricplt.e2mgr.client.model.NodebIdentity; -import org.oransc.ricplt.e2mgr.client.model.ResetRequest; +import org.oransc.ricplt.e2mgr.client.model.UpdateGnbRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.ParameterizedTypeReference; @@ -41,28 +43,25 @@ import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class E2ManagerControllerTest extends AbstractControllerTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - private ResponseEntity reset() { + @Test + public void updateGnb() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, - RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_PREFIX, "ignored", - E2ManagerController.RESET_METHOD); + RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_PREFIX, "nobeb"); logger.info("Invoking {}", uri); - ResetRequest reset = new ResetRequest(); - HttpEntity entity = new HttpEntity<>(reset); - return testRestTemplateAdminRole().exchange(uri, HttpMethod.PUT, entity, Void.class); - } - - @Test - public void resetTest() { - ResponseEntity voidResponse = reset(); - logger.debug("resetTest: response {}", voidResponse); + UpdateGnbRequest update = new UpdateGnbRequest(); + HttpEntity entity = new HttpEntity<>(update); + ResponseEntity voidResponse = testRestTemplateAdminRole().exchange(uri, HttpMethod.PUT, entity, + Void.class); Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful()); } @Test + @Order(1) public void versionTest() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.VERSION_METHOD); logger.info("Invoking {}", uri); @@ -71,6 +70,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest { } @Test + @Order(2) public void healthTest() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.HEALTH_METHOD); @@ -80,6 +80,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest { } @Test + @Order(3) public void ranDetailsTest() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.RAN_METHOD); @@ -91,6 +92,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest { } @Test + @Order(4) public void nodebListTest() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_LIST_METHOD); @@ -102,6 +104,7 @@ public class E2ManagerControllerTest extends AbstractControllerTest { } @Test + @Order(5) public void nodebStatusTest() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_PREFIX, @@ -112,7 +115,8 @@ public class E2ManagerControllerTest extends AbstractControllerTest { } // Aka big--button test, run this last - @After + @Test + @Order(6) public void nodebShutdownPutTest() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_SHUTDOWN_METHOD);