From f6755e34a8968756b59ca65bec50116530d40a48 Mon Sep 17 00:00:00 2001 From: MD IRSHAD SHEIKH Date: Mon, 12 Jul 2021 16:14:53 +0530 Subject: Add Junit coverage Issue-ID: SO-3707 Signed-off-by: MD IRSHAD SHEIKH Change-Id: I76af230437d54a0142f3f963f555ac1589ad954b --- .../rest/api/SoMonitoringController.java | 4 +- .../org/onap/so/monitoring/rest/api/Constants.java | 38 +++ .../so/monitoring/rest/api/SoMonitoringTest.java | 311 +++++++++++++++++++++ .../resources/catalogResponses/EmptyResponse.json | 1 + .../catalogResponses/networkRecipeResponse.json | 5 + .../catalogResponses/serviceRecipeRequest.json | 7 + .../serviceRecipeRequest_TypeNetwork.json | 7 + .../serviceRecipeRequest_TypeVnf.json | 7 + .../catalogResponses/serviceRecipeResponse.json | 11 + .../serviceRecipeResponse_complete.json | 224 +++++++++++++++ .../catalogResponses/serviceResponse.json | 4 + .../service_Model_Version_Not_Exist.json | 4 + .../service_ServiceActionConflict.json | 11 + .../service_Type_Network_Response.json | 4 + .../service_Type_Vnf_Response.json | 4 + .../catalogResponses/vnfRecipeResponse.json | 5 + 16 files changed, 645 insertions(+), 2 deletions(-) create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringTest.java create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/EmptyResponse.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/networkRecipeResponse.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeNetwork.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeVnf.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse_complete.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceResponse.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Model_Version_Not_Exist.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_ServiceActionConflict.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Network_Response.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Vnf_Response.json create mode 100644 so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/vnfRecipeResponse.json diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java index 2f25da1..1069dd3 100644 --- a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java @@ -552,7 +552,7 @@ public class SoMonitoringController { @Produces({MediaType.APPLICATION_JSON}) public Response getServiceRecipes() { try { - LOGGER.info(" SoMonitoringController setServiceRecipes request recieved"); + LOGGER.info(" SoMonitoringController getServiceRecipes request recieved"); List serviceRecipes = catalogDbClient.getServiceRecipes(); Map>> mapNetworkRecipes = new HashMap>>(); @@ -587,7 +587,7 @@ public class SoMonitoringController { @Produces({MediaType.APPLICATION_JSON}) public Response getNetworkRecipes() { try { - LOGGER.info(" SoMonitoringController setNetworkRecipes request recieved"); + LOGGER.info(" SoMonitoringController getNetworkRecipes request recieved"); List networkRecipes = catalogDbClient.getNetworkRecipes(); Map>> mapNetworkRecipes = new HashMap>>(); diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/Constants.java b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/Constants.java index aef8234..c237117 100644 --- a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/Constants.java +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/Constants.java @@ -39,6 +39,8 @@ public class Constants { public static final String SOURCE_TEST_FOLDER = "src/test/resources/camundaResponses/"; + public static final String SOURCE_CATALOG_FOLDER = "src/test/resources/catalogResponses/"; + public static final Path PROCESS_DEF_RESPONSE_JSON_FILE = Paths.get(SOURCE_TEST_FOLDER + "processDefinition.json"); public static final Path ACTIVITY_INSTANCE_RESPONSE_JSON_FILE = @@ -56,6 +58,42 @@ public class Constants { public static final Path SEARCH_RESULT_RESPONSE_JSON_FILE = Paths.get("src/test/resources/databaseResponses/searchResult.json"); + public static final Path SERVICE_RECIPE_RESPONSE_JSON_FILE = + Paths.get(SOURCE_CATALOG_FOLDER + "serviceRecipeResponse.json"); + + public static final Path SERVICE_RECIPE_REQUEST_JSON_FILE = + Paths.get(SOURCE_CATALOG_FOLDER + "serviceRecipeRequest.json"); + + public static final Path NETWORK_RECIPE_RESPONSE_JSON_FILE = + Paths.get(SOURCE_CATALOG_FOLDER + "networkRecipeResponse.json"); + + public static final Path SERVICE_RESPONSE_JSON_FILE = + Paths.get(SOURCE_CATALOG_FOLDER + "serviceResponse.json"); + + public static final Path SERVICE_MODELVERSIONID_NOT_EXIST = + Paths.get(SOURCE_CATALOG_FOLDER + "service_Model_Version_Not_Exist.json"); + + public static final Path SERVICE_SERVICE_ACTION_CONFLICT = + Paths.get(SOURCE_CATALOG_FOLDER + "service_ServiceActionConflict.json"); + + public static final Path SERVICE_TYPE_NETWORK_REQUEST = + Paths.get(SOURCE_CATALOG_FOLDER + "serviceRecipeRequest_TypeNetwork.json"); + + public static final Path SERVICE_TYPE_NETWORK_RESPONSE = + Paths.get(SOURCE_CATALOG_FOLDER + "service_Type_Network_Response.json"); + + public static final Path SERVICE_TYPE_VNF_REQUEST = + Paths.get(SOURCE_CATALOG_FOLDER + "serviceRecipeRequest_TypeVnf.json"); + + public static final Path VNF_RECIPE_RESPONSE_JSON_FILE = + Paths.get(SOURCE_CATALOG_FOLDER + "vnfRecipeResponse.json"); + + public static final Path SERVICE_TYPE_VNF_RESPONSE = + Paths.get(SOURCE_CATALOG_FOLDER + "service_Type_Vnf_Response.json"); + + public static final Path EMPTY_RESPONSE_JSON_FILE = + Paths.get(SOURCE_CATALOG_FOLDER + "EmptyResponse.json"); + public static final String ID = UUID.randomUUID().toString(); public static final long END_TIME_IN_MS = 1546351200000l; diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringTest.java b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringTest.java new file mode 100644 index 0000000..d6facae --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringTest.java @@ -0,0 +1,311 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 Huawei Technologies Co., Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.monitoring.rest.api; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.onap.so.db.catalog.beans.*; +import org.onap.so.db.catalog.beans.ServiceRecipe; +import org.onap.so.db.catalog.client.CatalogDbClient; +import org.onap.so.rest.catalog.beans.Service; +import org.onap.so.monitoring.db.service.DatabaseServiceProvider; +import org.onap.so.monitoring.rest.service.CamundaProcessDataServiceProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.doReturn; + +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_RECIPE_REQUEST_JSON_FILE; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_RECIPE_RESPONSE_JSON_FILE; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_RESPONSE_JSON_FILE; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_MODELVERSIONID_NOT_EXIST; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_SERVICE_ACTION_CONFLICT; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_TYPE_NETWORK_REQUEST; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_TYPE_NETWORK_RESPONSE; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_TYPE_VNF_REQUEST; +import static org.onap.so.monitoring.rest.api.Constants.SERVICE_TYPE_VNF_RESPONSE; +import static org.onap.so.monitoring.rest.api.Constants.NETWORK_RECIPE_RESPONSE_JSON_FILE; +import static org.onap.so.monitoring.rest.api.Constants.VNF_RECIPE_RESPONSE_JSON_FILE; +import static org.onap.so.monitoring.rest.api.Constants.EMPTY_RESPONSE_JSON_FILE; +import static org.onap.so.monitoring.rest.api.Constants.EMPTY_STRING; +import static org.onap.so.monitoring.rest.api.Constants.EMPTY_ARRAY_RESPONSE; + +/** + * @author md.irshad.sheikh@huawei.com + */ +@RunWith(MockitoJUnitRunner.class) +public class SoMonitoringTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(SoMonitoringTest.class); + + @Autowired + private DatabaseServiceProvider databaseServiceProvider; + + @Autowired + private CamundaProcessDataServiceProvider camundaProcessDataServiceProvider; + + @Mock + private CatalogDbClient catalogDbClient; + + @InjectMocks + private SoMonitoringController injectSoMoni = + new SoMonitoringController(databaseServiceProvider, camundaProcessDataServiceProvider); + + private final ObjectMapper mapper = new ObjectMapper(); + + @Test + public void test_getServiceRecipes() throws IOException { + + ServiceRecipe serviceRecipe = mapper.readValue(new String(Files.readAllBytes(SERVICE_RECIPE_RESPONSE_JSON_FILE)), + ServiceRecipe.class); + List serviceRecipes = new ArrayList(); + serviceRecipes.add(serviceRecipe); + + doReturn(serviceRecipes).when(catalogDbClient).getServiceRecipes(); + + final Response response = injectSoMoni.getServiceRecipes(); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + + JSONObject obj = new JSONObject(response.getEntity().toString()); + JSONArray actualServiceRecipe = obj.getJSONArray("serviceRecipes"); + assertEquals("48cc36cc-a9fe-11e7-8b4b-0242ac120002", actualServiceRecipe.getJSONObject(0).getString("serviceModelUUID")); + } + + @Test + public void test_getServiceRecipesWithEmpty() throws IOException { + + doReturn(null).when(catalogDbClient).getServiceRecipes(); + + final Response response = injectSoMoni.getServiceRecipes(); + JSONObject obj = new JSONObject(response.getEntity().toString()); + assertEquals("Unable to process.", obj.getString("errMsg")); + } + + @Test + public void test_getNetworkRecipes() throws IOException { + + ObjectMapper mapper = new ObjectMapper(); + NetworkRecipe networkRecipe = mapper.readValue(new String(Files.readAllBytes(NETWORK_RECIPE_RESPONSE_JSON_FILE)), + NetworkRecipe.class); + List networkRecipes = new ArrayList(); + networkRecipes.add(networkRecipe); + doReturn(networkRecipes).when(catalogDbClient).getNetworkRecipes(); + + final Response response = injectSoMoni.getNetworkRecipes(); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + + JSONObject obj = new JSONObject(response.getEntity().toString()); + JSONArray actualServiceRecipe = obj.getJSONArray("networkRecipes"); + assertEquals("deleteInstance", actualServiceRecipe.getJSONObject(0).getString("action")); + } + + @Test + public void test_getNetworkRecipesWithEmpty() throws IOException { + + doReturn(null).when(catalogDbClient).getNetworkRecipes(); + + final Response response = injectSoMoni.getNetworkRecipes(); + JSONObject obj = new JSONObject(response.getEntity().toString()); + assertEquals("Unable to process.", obj.getString("errMsg")); + } + + @Test + public void test_getVnfRecipes() throws IOException { + + ObjectMapper mapper = new ObjectMapper(); + VnfRecipe vnfRecipe = mapper.readValue(new String(Files.readAllBytes(VNF_RECIPE_RESPONSE_JSON_FILE)), + VnfRecipe.class); + List vnfRecipes = new ArrayList(); + vnfRecipes.add(vnfRecipe); + doReturn(vnfRecipes).when(catalogDbClient).getVnfRecipes(); + + final Response response = injectSoMoni.getVnfRecipes(); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + JSONObject obj = new JSONObject(response.getEntity().toString()); + JSONArray actualServiceRecipe = obj.getJSONArray("vnfRecipes"); + assertEquals("deleteInstance", actualServiceRecipe.getJSONObject(0).getString("action")); + } + + @Test + public void test_getVnfRecipesWithEmpty() throws IOException { + + doReturn(null).when(catalogDbClient).getVnfRecipes(); + + final Response response = injectSoMoni.getVnfRecipes(); + JSONObject obj = new JSONObject(response.getEntity().toString()); + assertEquals("Unable to process.", obj.getString("errMsg")); + } + + @Test + public void test_setServiceRecipes_ServiceActionConflict() throws IOException { + + final String jsonRequestString = new String(Files.readAllBytes(SERVICE_RECIPE_REQUEST_JSON_FILE)); + + ObjectMapper mapper = new ObjectMapper(); + + ServiceRecipe serviceRecipe = mapper.readValue(new String(Files.readAllBytes(SERVICE_SERVICE_ACTION_CONFLICT)), + ServiceRecipe.class); + Service service = mapper.readValue(new String(Files.readAllBytes(SERVICE_RESPONSE_JSON_FILE)), Service.class); + + List serviceRecipes = new ArrayList(); + List services = new ArrayList(); + + serviceRecipes.add(serviceRecipe); + services.add(service); + doReturn(services).when(catalogDbClient).getServices(); + doReturn(serviceRecipes).when(catalogDbClient).getServiceRecipes(); + + final Response response = injectSoMoni.setServiceRecipes(jsonRequestString); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + + JSONObject obj = new JSONObject(response.getEntity().toString()); + assertEquals("The recipe for this action of the service template already exists.", + obj.getString("errMsg")); + } + + @Test + public void test_setServiceRecipes_EmptyJson() throws IOException { + + final String jsonRequestString = new String(Files.readAllBytes(EMPTY_RESPONSE_JSON_FILE)); + + final Response response = injectSoMoni.setServiceRecipes(jsonRequestString); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + } + + @Test + public void test_setServiceRecipes_EmptyString() throws IOException { + + final String jsonRequestString = new String(EMPTY_STRING); + + final Response response = injectSoMoni.setServiceRecipes(jsonRequestString); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + } + + @Test + public void test_setServiceRecipes_ServiceModelVersionIdNotExists() throws IOException { + + final String jsonRequestString = new String(Files.readAllBytes(SERVICE_RECIPE_REQUEST_JSON_FILE)); + + ObjectMapper mapper = new ObjectMapper(); + + Service service = mapper.readValue(new String(Files.readAllBytes(SERVICE_MODELVERSIONID_NOT_EXIST)), Service.class); + + List services = new ArrayList(); + + services.add(service); + doReturn(services).when(catalogDbClient).getServices(); + + final Response response = injectSoMoni.setServiceRecipes(jsonRequestString); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); + JSONObject serviceRecipeObj = new JSONObject(response.getEntity().toString()); + assertEquals("The service template does not exist.", + serviceRecipeObj.getString("errMsg")); + } + + @Test + public void test_setServiceRecipes_Success() throws IOException { + + final String jsonRequestString = new String(Files.readAllBytes(SERVICE_RECIPE_REQUEST_JSON_FILE)); + + ObjectMapper mapper = new ObjectMapper(); + + ServiceRecipe serviceRecipe = mapper.readValue(new String(Files.readAllBytes(SERVICE_RECIPE_RESPONSE_JSON_FILE)), + ServiceRecipe.class); + Service service = mapper.readValue(new String(Files.readAllBytes(SERVICE_RESPONSE_JSON_FILE)), Service.class); + + List serviceRecipes = new ArrayList(); + List services = new ArrayList(); + + serviceRecipes.add(serviceRecipe); + services.add(service); + doReturn(services).when(catalogDbClient).getServices(); + doReturn(serviceRecipes).when(catalogDbClient).getServiceRecipes(); + + final Response response = injectSoMoni.setServiceRecipes(jsonRequestString); + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + JSONObject serviceRecipeObj = new JSONObject(response.getEntity().toString()); + assertEquals("48cc36cc-a9fe-11e7-8b4b-0242ac120002", serviceRecipeObj.getString("modelVersionId")); + } + + @Test + public void test_setServiceRecipes_TypeNetwork_Success() throws IOException { + final String jsonRequestString = new String(Files.readAllBytes(SERVICE_TYPE_NETWORK_REQUEST)); + + ObjectMapper mapper = new ObjectMapper(); + + NetworkRecipe networkRecipe = mapper.readValue(new String(Files.readAllBytes(NETWORK_RECIPE_RESPONSE_JSON_FILE)), + NetworkRecipe.class); + List networkRecipes = new ArrayList(); + networkRecipes.add(networkRecipe); + doReturn(networkRecipes).when(catalogDbClient).getNetworkRecipes(); + + NetworkResource networkResource = mapper.readValue(new String(Files.readAllBytes(SERVICE_TYPE_NETWORK_RESPONSE)), + NetworkResource.class); + List networkResources = new ArrayList(); + + networkResources.add(networkResource); + doReturn(networkResources).when(catalogDbClient).getNetworkResources(); + + final Response response = injectSoMoni.setServiceRecipes(jsonRequestString); + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + + JSONObject serviceRecipeObj = new JSONObject(response.getEntity().toString()); + assertEquals("48cc36cc-a9fe-11e7-8b4b-0242ac120002", serviceRecipeObj.getString("modelVersionId")); + } + + @Test + public void test_setServiceRecipes_TypeVnf_Success() throws IOException { + final String jsonRequestString = new String(Files.readAllBytes(SERVICE_TYPE_VNF_REQUEST)); + + ObjectMapper mapper = new ObjectMapper(); + + VnfRecipe vnfRecipe = mapper.readValue(new String(Files.readAllBytes(VNF_RECIPE_RESPONSE_JSON_FILE)), + VnfRecipe.class); + List vnfRecipes = new ArrayList(); + vnfRecipes.add(vnfRecipe); + doReturn(vnfRecipes).when(catalogDbClient).getVnfRecipes(); + + VnfResource vnfResource = mapper.readValue(new String(Files.readAllBytes(SERVICE_TYPE_VNF_RESPONSE)), + VnfResource.class); + List vnfResources = new ArrayList(); + + vnfResources.add(vnfResource); + doReturn(vnfResources).when(catalogDbClient).getVnfResources(); + + final Response response = injectSoMoni.setServiceRecipes(jsonRequestString); + assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); + + JSONObject serviceRecipeObj = new JSONObject(response.getEntity().toString()); + assertEquals("48cc36cc-a9fe-11e7-8b4b-0242ac120002", serviceRecipeObj.getString("modelVersionId")); + } + +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/EmptyResponse.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/EmptyResponse.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/EmptyResponse.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/networkRecipeResponse.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/networkRecipeResponse.json new file mode 100644 index 0000000..0dfdabc --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/networkRecipeResponse.json @@ -0,0 +1,5 @@ +{ + "id": 1, + "versionStr": "cr", + "action": "deleteInstance" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest.json new file mode 100644 index 0000000..9738003 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest.json @@ -0,0 +1,7 @@ +{ + "modelName": "cr", + "modelVersionId": "48cc36cc-a9fe-11e7-8b4b-0242ac120002", + "operation": "createInstance", + "orchestrationFlow": "cr", + "modelType": "Service" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeNetwork.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeNetwork.json new file mode 100644 index 0000000..acdb0e9 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeNetwork.json @@ -0,0 +1,7 @@ +{ + "modelName": "cr", + "modelVersionId": "48cc36cc-a9fe-11e7-8b4b-0242ac120002", + "operation": "createInstance", + "orchestrationFlow": "cr", + "modelType": "Network" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeVnf.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeVnf.json new file mode 100644 index 0000000..b5d3f5b --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeRequest_TypeVnf.json @@ -0,0 +1,7 @@ +{ + "modelName": "cr", + "modelVersionId": "48cc36cc-a9fe-11e7-8b4b-0242ac120002", + "operation": "createInstance", + "orchestrationFlow": "cr", + "modelType": "Vnf" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse.json new file mode 100644 index 0000000..6c5f2f3 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse.json @@ -0,0 +1,11 @@ +{ + "id": 1, + "serviceModelUUID": "48cc36cc-a9fe-11e7-8b4b-0242ac120002", + "action": "deleteInstance", + "description": "Vnf api recipe to create service-instance", + "orchestrationUri": "/mso/async/services/CreateGenericALaCarteServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + } diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse_complete.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse_complete.json new file mode 100644 index 0000000..c876a12 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceRecipeResponse_complete.json @@ -0,0 +1,224 @@ +{ + "serviceRecipe": [ + { + "id": 1, + "serviceModelUUID": "48cc36cc-a9fe-11e7-8b4b-0242ac120002", + "action": "createInstance", + "description": "Vnf api recipe to create service-instance", + "orchestrationUri": "/mso/async/services/CreateGenericALaCarteServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + }, + { + "id": 2, + "serviceModelUUID": "48cc36cc-a9fe-11e7-8b4b-0242ac120002", + "action": "deleteInstance", + "description": "Vnf api recipe to delete service-instance", + "orchestrationUri": "/mso/async/services/DeleteGenericALaCarteServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + }, + { + "id": 3, + "serviceModelUUID": "48cc3acd-a9fe-11e7-8b4b-0242ac120002", + "action": "createInstance", + "description": "DEFAULT recipe to create service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/CreateGenericALaCarteServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + }, + { + "id": 4, + "serviceModelUUID": "48cc3acd-a9fe-11e7-8b4b-0242ac120002", + "action": "deleteInstance", + "description": "DEFAULT recipe to delete service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/DeleteGenericALaCarteServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + }, + { + "id": 11, + "serviceModelUUID": "dfcd7471-16c7-444e-8268-d4c50d90593a", + "action": "createInstance", + "description": "Custom recipe to create E2E service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/CreateCustomE2EServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + }, + { + "id": 12, + "serviceModelUUID": "dfcd7471-16c7-444e-8268-d4c50d90593a", + "action": "deleteInstance", + "description": "Custom recipe to delete E2E service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/DeleteCustomE2EServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + }, + { + "id": 15, + "serviceModelUUID": "dfcd7471-16c7-444e-8268-d4c50d90593a", + "action": "updateInstance", + "description": "Custom recipe to update E2E service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/UpdateCustomE2EServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2018-03-05T10:52:03.000+00:00" + }, + { + "id": 16, + "serviceModelUUID": "dfcd7471-16c7-444e-8268-d4c50d90593a", + "action": "scaleInstance", + "description": "Custom recipe to scale E2E service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/ScaleCustomE2EServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2018-05-15T18:52:03.000+00:00" + }, + { + "id": 17, + "serviceModelUUID": "3d30a774-e149-11ea-87d0-0242ac130003", + "action": "createInstance", + "description": "Custom recipe to allocate 3gpp service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/AllocateSliceSubnet", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2020-08-18T17:40:03.000+00:00" + }, + { + "id": 18, + "serviceModelUUID": "3d30a774-e149-11ea-87d0-0242ac130003", + "action": "deleteInstance", + "description": "Custom recipe to deallocate 3gpp service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/DeAllocateSliceSubnet", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2020-08-18T18:40:03.000+00:00" + }, + { + "id": 19, + "serviceModelUUID": "3d30a774-e149-11ea-87d0-0242ac130003", + "action": "updateInstance", + "description": "Custom recipe to modify 3gpp service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/ModifySliceSubnet", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2020-08-18T18:40:03.000+00:00" + }, + { + "id": 20, + "serviceModelUUID": "3d30a774-e149-11ea-87d0-0242ac130003", + "action": "activateInstance", + "description": "Custom recipe to activate/deactivate 3gpp service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/ActivateSliceSubnet", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2020-08-18T18:40:03.000+00:00" + }, + { + "id": 21, + "serviceModelUUID": "3d30a774-e149-11ea-87d0-0242ac130003", + "action": "deactivateInstance", + "description": "Custom recipe to activate/deactivate 3gpp service-instance if no custom BPMN flow is found", + "orchestrationUri": "/mso/async/services/ActivateSliceSubnet", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2020-08-18T18:40:03.000+00:00" + }, + { + "id": 500, + "serviceModelUUID": "d88da85c-d9e8-4f73-b837-3a72a431622b", + "action": "updateInstance", + "description": "Gr api recipe to update service-instance", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + }, + { + "id": 501, + "serviceModelUUID": "d88da85c-d9e8-4f73-b837-3a72a431622b", + "action": "activateInstance", + "description": "Gr api recipe to activate service-instance", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2021-07-01T10:41:12.000+00:00" + }, + { + "id": 502, + "serviceModelUUID": "d88da85c-d9e8-4f73-b837-3a72a431622b", + "action": "createInstance", + "description": "Gr api recipe to create service-instance", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2021-07-01T10:41:12.000+00:00" + }, + { + "id": 503, + "serviceModelUUID": "d88da85c-d9e8-4f73-b837-3a72a431622b", + "action": "deactivateInstance", + "description": "Gr api recipe to deactivate service-instance", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2021-07-01T10:41:12.000+00:00" + }, + { + "id": 504, + "serviceModelUUID": "d88da85c-d9e8-4f73-b837-3a72a431622b", + "action": "deleteInstance", + "description": "Gr api recipe to delete service-instance", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2021-07-01T10:41:12.000+00:00" + }, + { + "id": 505, + "serviceModelUUID": "d88da85c-d9e8-4f73-b837-3a72a431622b", + "action": "assignInstance", + "description": "Gr api recipe to assign service-instance", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2021-07-01T10:41:12.000+00:00" + }, + { + "id": 506, + "serviceModelUUID": "d88da85c-d9e8-4f73-b837-3a72a431622b", + "action": "unassignInstance", + "description": "Gr api recipe to unassign service-instance", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2021-07-01T10:41:12.000+00:00" + } + ] +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceResponse.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceResponse.json new file mode 100644 index 0000000..c7b102b --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/serviceResponse.json @@ -0,0 +1,4 @@ +{ + "modelName": "cr", + "modelVersionId": "48cc36cc-a9fe-11e7-8b4b-0242ac120002" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Model_Version_Not_Exist.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Model_Version_Not_Exist.json new file mode 100644 index 0000000..276eff4 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Model_Version_Not_Exist.json @@ -0,0 +1,4 @@ +{ + "modelName": "cr", + "modelVersionId": "cr" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_ServiceActionConflict.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_ServiceActionConflict.json new file mode 100644 index 0000000..bf20424 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_ServiceActionConflict.json @@ -0,0 +1,11 @@ +{ + "id": 1, + "serviceModelUUID": "48cc36cc-a9fe-11e7-8b4b-0242ac120002", + "action": "createInstance", + "description": "Vnf api recipe to create service-instance", + "orchestrationUri": "/mso/async/services/CreateGenericALaCarteServiceInstance", + "paramXsd": null, + "recipeTimeout": 180, + "serviceTimeoutInterim": null, + "created": "2017-10-05T18:52:03.000+00:00" + } diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Network_Response.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Network_Response.json new file mode 100644 index 0000000..1ab9c48 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Network_Response.json @@ -0,0 +1,4 @@ +{ + "modelName": "cr", + "modelVersion": "48cc36cc-a9fe-11e7-8b4b-0242ac120002" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Vnf_Response.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Vnf_Response.json new file mode 100644 index 0000000..1ab9c48 --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/service_Type_Vnf_Response.json @@ -0,0 +1,4 @@ +{ + "modelName": "cr", + "modelVersion": "48cc36cc-a9fe-11e7-8b4b-0242ac120002" +} \ No newline at end of file diff --git a/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/vnfRecipeResponse.json b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/vnfRecipeResponse.json new file mode 100644 index 0000000..0dfdabc --- /dev/null +++ b/so-admin-cockpit-monitoring-workflow/so-admin-cockpit-monitoring-workflow-service/src/test/resources/catalogResponses/vnfRecipeResponse.json @@ -0,0 +1,5 @@ +{ + "id": 1, + "versionStr": "cr", + "action": "deleteInstance" +} \ No newline at end of file -- cgit 1.2.3-korg