diff options
author | Timoney, Dan (dt5972) <dt5972@att.com> | 2021-10-29 14:47:40 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2021-11-01 10:17:41 -0400 |
commit | 5b935a9086ec1080f896b9a71c52283122aa0163 (patch) | |
tree | f28aee1327e5b6c8ad423dec5950d46f66ac201b /ms/gra/gra-app/src/test/java | |
parent | 53b2788231f5ab3aeda4f09e1445a02c3a3b6be9 (diff) |
Sync local changes to support GRA microservice
Sync changes made downstream to support GRA microservice
Change-Id: If3bf5d879f7d61ab91209c63b0344d78128246a8
Issue-ID: CCSDK-3504
Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'ms/gra/gra-app/src/test/java')
2 files changed, 6 insertions, 23 deletions
diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiPreloadControllerTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiPreloadControllerTest.java index 95226f7..8c311fb 100644 --- a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiPreloadControllerTest.java +++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiPreloadControllerTest.java @@ -131,7 +131,7 @@ public class ConfigApiPreloadControllerTest { // Clean up data configPreloadDataRepository.deleteAll(); - String content = readFileContent("src/test/resources/preload1-net-model-info.json"); + String content = readFileContent("src/test/resources/preload1-net-list-item.json"); MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_PRELOAD_LIST_URL).contentType(MediaType.APPLICATION_JSON).content(content)) .andReturn(); @@ -220,17 +220,11 @@ public class ConfigApiPreloadControllerTest { // Clean up data configPreloadDataRepository.deleteAll(); - String badContent = readFileContent("src/test/resources/preload1-net-model-info.json"); String goodContent = readFileContent("src/test/resources/preload1-net-list-item.json"); - // Test with bad file content - MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_PRELOAD_LIST_URL+"preload1/network/").contentType(MediaType.APPLICATION_JSON).content(badContent)) - .andReturn(); - assertEquals(400, mvcResult.getResponse().getStatus()); - assertEquals(0, configPreloadDataRepository.count()); // Test with no data - mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_PRELOAD_LIST_URL+"preload1/network/").contentType(MediaType.APPLICATION_JSON).content(goodContent)) + MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_PRELOAD_LIST_URL+"preload1/network/").contentType(MediaType.APPLICATION_JSON).content(goodContent)) .andReturn(); assertEquals(201, mvcResult.getResponse().getStatus()); assertEquals(1, configPreloadDataRepository.count()); @@ -318,11 +312,6 @@ public class ConfigApiPreloadControllerTest { preloadData.setPreloadData(null); configPreloadDataRepository.save(preloadData); - // Test with bad file content - MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_PRELOAD_LIST_URL+"preload1/network/preload-data/").contentType(MediaType.APPLICATION_JSON).content(badContent)) - .andReturn(); - assertEquals(400, mvcResult.getResponse().getStatus()); - assertEquals(1, configPreloadDataRepository.count()); } @@ -399,12 +388,6 @@ public class ConfigApiPreloadControllerTest { preloadData.setPreloadData(null); configPreloadDataRepository.save(preloadData); - // Test with bad file content - MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_PRELOAD_LIST_URL+"preload1/network/preload-data/").contentType(MediaType.APPLICATION_JSON).content(badContent)) - .andReturn(); - assertEquals(400, mvcResult.getResponse().getStatus()); - assertEquals(1, configPreloadDataRepository.count()); - } @Test diff --git a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java index 603ff20..dd5a6a4 100644 --- a/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java +++ b/ms/gra/gra-app/src/test/java/org/onap/sdnc/apps/ms/gra/controllers/ConfigApiServicesControllerTest.java @@ -182,7 +182,7 @@ public class ConfigApiServicesControllerTest { // Clean up data clearServicesData(); - String content = readFileContent("src/test/resources/service1.json"); + String content = readFileContent("src/test/resources/service1-services.json"); // Test with no data MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(content)) @@ -206,7 +206,7 @@ public class ConfigApiServicesControllerTest { // Clean up data clearServicesData(); - String content = readFileContent("src/test/resources/service1.json"); + String content = readFileContent("src/test/resources/service1-services.json"); // Test with no data MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put(CONFIG_SERVICES_URL).contentType(MediaType.APPLICATION_JSON).content(content)) @@ -643,12 +643,12 @@ public class ConfigApiServicesControllerTest { clearServicesData(); assertEquals(0, configServicesRepository.count()); assertEquals(0, configVnfsRepository.count()); - MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put("/config/GENERIC-RESOURCE-API:services/service/"+TEST_SVC_INSTANCE_ID+"/service-data/vnfs/vnf/"+TEST_VNF_ID+"/").contentType(MediaType.APPLICATION_JSON).content(readFileContent("src/test/resources/vnf-data.json"))) + MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.put("/config/GENERIC-RESOURCE-API:services/service/"+TEST_SVC_INSTANCE_ID+"/service-data/vnfs/vnf/"+TEST_VNF_ID+"/").contentType(MediaType.APPLICATION_JSON).content(readFileContent("src/test/resources/vnf.json"))) .andReturn(); assertEquals(201, mvcResult.getResponse().getStatus()); assertEquals(1, configVnfsRepository.count()); - mvcResult = mvc.perform(MockMvcRequestBuilders.put("/config/GENERIC-RESOURCE-API:services/service/"+TEST_SVC_INSTANCE_ID+"/service-data/vnfs/vnf/"+TEST_VNF_ID+"/").contentType(MediaType.APPLICATION_JSON).content(readFileContent("src/test/resources/vnf-data.json"))) + mvcResult = mvc.perform(MockMvcRequestBuilders.put("/config/GENERIC-RESOURCE-API:services/service/"+TEST_SVC_INSTANCE_ID+"/service-data/vnfs/vnf/"+TEST_VNF_ID+"/").contentType(MediaType.APPLICATION_JSON).content(readFileContent("src/test/resources/vnf.json"))) .andReturn(); assertEquals(204, mvcResult.getResponse().getStatus()); assertEquals(1, configVnfsRepository.count()); |