summaryrefslogtreecommitdiffstats
path: root/ms/generic-resource-api/src/test
diff options
context:
space:
mode:
authorDavid Stilwell <stilwelld@att.com>2020-11-19 16:56:21 -0500
committerDavid Stilwell <stilwelld@att.com>2020-11-19 16:56:37 -0500
commitdb82751c50a962ff3d731b89837f747aac71d72f (patch)
tree195107ad0364c0299f558db3dcc1bf65ad4e658c /ms/generic-resource-api/src/test
parent15dface554938da7b737924bae9713fa6b5ef794 (diff)
add support for service-toplogy GET
Changes made: 1. add method for ServiceTopologyGet(), added junit test case Issue-ID: SDNC-1422 Change-Id: I770ff1fe9dbab7b06c2df4eb24d3e39eb3fa5cc9 Signed-off-by: David Stilwell <stilwelld@att.com>
Diffstat (limited to 'ms/generic-resource-api/src/test')
-rw-r--r--ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java b/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java
index 7bcfefe..b9ec3de 100644
--- a/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java
+++ b/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java
@@ -464,6 +464,26 @@ public class ConfigApiServicesControllerTest {
}
@Test
+ public void configGENERICRESOURCEAPIservicesServiceServiceInstanceIdServiceDataServiceTopologyGet() throws Exception {
+ // Clean up data
+ configServicesRepository.deleteAll();
+
+ // Test with data
+ loadServicesData("src/test/resources/service1.json");
+ assert(configServicesRepository.count() > 0);
+
+ MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/service-data/service-topology/").contentType(MediaType.APPLICATION_JSON).content(""))
+ .andReturn();
+ assertEquals(200, mvcResult.getResponse().getStatus());
+
+ // Test with no data
+ configServicesRepository.deleteAll();
+ mvcResult = mvc.perform(MockMvcRequestBuilders.get(CONFIG_SERVICES_SERVICE_URL+"service1/service-data/service-topology/").contentType(MediaType.APPLICATION_JSON).content(""))
+ .andReturn();
+ assertEquals(404, mvcResult.getResponse().getStatus());
+ }
+
+ @Test
public void configGENERICRESOURCEAPIservicesServiceServiceInstanceIdServiceDataVnfsVnfVnfIdDelete() throws Exception {
// Clean up data
configServicesRepository.deleteAll();