diff options
author | EzekielaRakotoarijaona <ezekiela.rakotoarijaona@orange.com> | 2019-01-11 14:53:30 +0100 |
---|---|---|
committer | EzekielaRakotoarijaona <ezekiela.rakotoarijaona@orange.com> | 2019-01-18 17:28:05 +0100 |
commit | 05733ab5105f440e44eb56dc37e6d14615c36454 (patch) | |
tree | 3989eb8552ab271c9d5ba0a37b99960c49b36259 /src | |
parent | 09d6ce6112d61a7fc98c3038afce636b3e494f29 (diff) |
Fix unit testing instability
Migration of most of the unit tests from JUnit to Karate Framework
Remove of the scheduling tasks for testing.
Change-Id: Ic51378443bd6c12f247fa50b2b08ee881264dac4
Issue-ID: EXTAPI-178
Signed-off-by: EzekielaRakotoarijaona <ezekiela.rakotoarijaona@orange.com>
Diffstat (limited to 'src')
34 files changed, 3115 insertions, 2665 deletions
diff --git a/src/main/java/org/onap/nbi/Application.java b/src/main/java/org/onap/nbi/Application.java index 05588b4..9f77ffe 100644 --- a/src/main/java/org/onap/nbi/Application.java +++ b/src/main/java/org/onap/nbi/Application.java @@ -1,22 +1,21 @@ /** * Copyright (c) 2018 Orange * <p> - * 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 + * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> - * 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. + * 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. */ package org.onap.nbi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication @@ -24,7 +23,11 @@ import org.springframework.scheduling.annotation.EnableAsync; public class Application { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + run(args); + } + + public static ConfigurableApplicationContext run(String[] args) { + return SpringApplication.run(Application.class, args); } } diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/ServiceOrderResource.java b/src/main/java/org/onap/nbi/apis/serviceorder/ServiceOrderResource.java index e3f4442..2cd1c9a 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/ServiceOrderResource.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/ServiceOrderResource.java @@ -33,8 +33,6 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.util.MultiValueMap; import org.springframework.validation.Errors; import org.springframework.web.bind.annotation.*; @@ -44,11 +42,8 @@ import java.util.List; @RestController @RequestMapping("/serviceOrder") -@EnableScheduling public class ServiceOrderResource extends ResourceManagement { - - @Autowired ServiceOrderService serviceOrderService; @@ -71,6 +66,8 @@ public class ServiceOrderResource extends ResourceManagement { MultiCriteriaRequestBuilder multiCriteriaRequestBuilder; + + @GetMapping(value = "/{serviceOrderId}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Object> getServiceOrder(@PathVariable String serviceOrderId, @RequestParam MultiValueMap<String, String> params) { @@ -123,26 +120,33 @@ public class ServiceOrderResource extends ResourceManagement { } - @Scheduled(fixedDelay = 5000) - public void scheduleCheckServiceOrders() { - List<ServiceOrder> acknowledgedOrders = serviceOrderService.findServiceOrdersByState(StateType.ACKNOWLEDGED); - for (ServiceOrder serviceOrder : acknowledgedOrders) { - ServiceOrderInfo serviceOrderInfo = checkOrderConsistenceManager.checkServiceOrder(serviceOrder); - if (serviceOrderInfo.isServiceOrderRejected()) { - serviceOrderService.updateOrderState(serviceOrder, StateType.REJECTED); - } else if (serviceOrderInfo.isAllItemsCompleted()) { - serviceOrderService.updateOrderState(serviceOrder, StateType.COMPLETED); - } else { - createAAICustomer.createAAICustomer(serviceOrder,serviceOrderInfo); + + @PutMapping(value = "/test/{serviceOrderId}",consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity<Object> checkServiceOrderRessource(@PathVariable String serviceOrderId,@RequestParam MultiValueMap<String, String> params){ + ServiceOrder serviceOrder = serviceOrderService.findServiceOrderById(serviceOrderId); + serviceOrder = checkServiceOrder(serviceOrder); + JsonRepresentation filter = new JsonRepresentation(params); + return this.createResponse(serviceOrder,filter); + } + + + public ServiceOrder checkServiceOrder(ServiceOrder serviceOrder) { + ServiceOrderInfo serviceOrderInfo = checkOrderConsistenceManager.checkServiceOrder(serviceOrder); + if (serviceOrderInfo.isServiceOrderRejected()) { + serviceOrderService.updateOrderState(serviceOrder, StateType.REJECTED); + } else if (serviceOrderInfo.isAllItemsCompleted()) { + serviceOrderService.updateOrderState(serviceOrder, StateType.COMPLETED); + } else { + createAAICustomer.createAAICustomer(serviceOrder,serviceOrderInfo); + if(StateType.ACKNOWLEDGED==serviceOrder.getState()) { + createAAIServiceType.createAAIServiceType(serviceOrder, serviceOrderInfo); if(StateType.ACKNOWLEDGED==serviceOrder.getState()) { - createAAIServiceType.createAAIServiceType(serviceOrder, serviceOrderInfo); - if(StateType.ACKNOWLEDGED==serviceOrder.getState()) { - serviceOrchestratorManager.registerServiceOrder(serviceOrder, serviceOrderInfo); - } + serviceOrchestratorManager.registerServiceOrder(serviceOrder, serviceOrderInfo); } - } + } + return serviceOrder; } } diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/ExecutionTaskProcessorScheduler.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/ExecutionTaskProcessorScheduler.java new file mode 100644 index 0000000..ee72515 --- /dev/null +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/ExecutionTaskProcessorScheduler.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2018 Orange + * + * 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. + */ +package org.onap.nbi.apis.serviceorder.workflow; + +import java.util.List; +import org.onap.nbi.apis.serviceorder.model.orchestrator.ExecutionTask; +import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Profile; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +@Profile("default") +@Service +@EnableScheduling +public class ExecutionTaskProcessorScheduler { + + @Autowired + ExecutionTaskRepository executionTaskRepository; + + @Autowired + SOTaskProcessor soTaskProcessor; + + // Using fixedDelay to mitigate against Scheduler queue backlog with fixedRate + @Scheduled(fixedDelayString = "${executionTask.schedule}", initialDelayString = "${executionTask.initial}") + private void processExecutionPlan() throws InterruptedException { + List<ExecutionTask> taskToExecute = executionTaskRepository.findByReliedTasksIsEmpty(); + for (ExecutionTask executionTask : taskToExecute) { + soTaskProcessor.processOrderItem(executionTask); + } + } +} diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskManager.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskManager.java index be8bdc0..26569f6 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskManager.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskManager.java @@ -12,8 +12,6 @@ */
package org.onap.nbi.apis.serviceorder.workflow;
-import java.util.*;
-import java.util.Map.Entry;
import org.onap.nbi.apis.serviceorder.model.OrderItemRelationship;
import org.onap.nbi.apis.serviceorder.model.ServiceOrder;
import org.onap.nbi.apis.serviceorder.model.ServiceOrderItem;
@@ -25,9 +23,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
+import java.util.*;
+import java.util.Map.Entry;
+
@Service
@EnableScheduling
public class SOTaskManager {
@@ -94,12 +94,5 @@ public class SOTaskManager { registerOrderItemExecutionPlan(serviceOrder.getOrderItem(), serviceOrderInfoJson);
}
- // Using fixedDelay to mitigate against Scheduler queue backlog with fixedRate
- @Scheduled(fixedDelay = 2000)
- private void processExecutionPlan() throws InterruptedException {
- List<ExecutionTask> taskToExecute = executionTaskRepository.findByReliedTasksIsEmpty();
- for (ExecutionTask executionTask : taskToExecute) {
- soTaskProcessor.processOrderItem(executionTask);
- }
- }
+
}
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/ServiceOrderCheckScheduler.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/ServiceOrderCheckScheduler.java new file mode 100644 index 0000000..0d9f050 --- /dev/null +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/ServiceOrderCheckScheduler.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 Orange + * + * 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. + */ +package org.onap.nbi.apis.serviceorder.workflow; + +import java.util.List; +import org.onap.nbi.apis.serviceorder.ServiceOrderResource; +import org.onap.nbi.apis.serviceorder.model.ServiceOrder; +import org.onap.nbi.apis.serviceorder.model.StateType; +import org.onap.nbi.apis.serviceorder.service.ServiceOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Profile; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +@Profile("default") +@Service +@EnableScheduling +public class ServiceOrderCheckScheduler { + + @Autowired + ServiceOrderService serviceOrderService; + + @Autowired + ServiceOrderResource serviceOrderResource; + + + @Scheduled(fixedDelayString = "${serviceOrder.schedule}", initialDelayString = "${serviceOrder.initial}") + public void scheduleCheckServiceOrders() { + List<ServiceOrder> acknowledgedOrders = serviceOrderService + .findServiceOrdersByState(StateType.ACKNOWLEDGED); + for (ServiceOrder serviceOrder : acknowledgedOrders) { + serviceOrderResource.checkServiceOrder(serviceOrder); + } + } + +} diff --git a/src/main/java/org/onap/nbi/configuration/RestConfiguration.java b/src/main/java/org/onap/nbi/configuration/RestConfiguration.java index 835ce24..92108a4 100644 --- a/src/main/java/org/onap/nbi/configuration/RestConfiguration.java +++ b/src/main/java/org/onap/nbi/configuration/RestConfiguration.java @@ -21,6 +21,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; + @Configuration public class RestConfiguration { diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties new file mode 100644 index 0000000..b890216 --- /dev/null +++ b/src/main/resources/application-test.properties @@ -0,0 +1,72 @@ +# +# Copyright (c) 2018 Orange +# +# 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. +# + +nbi.version = v3 + +# SERVER +server.contextPath = /nbi/api/${nbi.version} +server.port = 8080 + +# LOGGING +logging.level. = ERROR + +# ONAP +onap.lcpCloudRegionId = RegionOne +onap.tenantId = 31047205ce114b60833b23e400d6a535 +onap.cloudOwner = CloudOwner + +# NBI +nbi.url = http://localhost:${server.port}${server.contextPath} +nbi.callForVNF = false + +# SCHEDULER +scheduler.pollingDurationInMins = 0.1 +serviceOrder.schedule = 5000 +serviceOrder.initial = 1 +executionTask.schedule = 2000 +executionTask.initial = 1 + + + +# SDC +sdc.host = http://127.0.0.1:8091 +sdc.header.ecompInstanceId = Rene +sdc.header.authorization = Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU= + +# AAI +aai.host = http://127.0.0.1:8091 +aai.header.authorization = Basic QUFJOkFBSQ== +aai.api.id = AAI +aai.header.transaction.id = 808b54e3-e563-4144-a1b9-e24e2ed93d4f + +# SO +so.host = http://127.0.0.1:8091 +so.header.authorization = +so.api.id = SO +so.owning.entity.id = 6b5b6b70-4e9a-4f6f-8b7b-cbd7cf990c6e +so.owning.entity.name = OE-generic +so.project.name = Project-generic + +# MSB +msb.enabled = false + +# H2 +spring.datasource.url = jdbc:h2:mem:~/db;DB_CLOSE_ON_EXIT=false +spring.datasource.username = sa +spring.datasource.password = +spring.datasource.driver-class-name = org.h2.Driver +spring.h2.console.enabled = true +spring.h2.console.path = /h2-console
\ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a6184f0..6a66737 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -14,71 +14,81 @@ # limitations under the License. # -nbi.version=v3 + +# PROFILE +# used for scheduling +spring.profiles.active = default + +# VERSION +nbi.version = v3 # SERVER -server.contextPath=/nbi/api/${nbi.version} -server.port=8080 +server.contextPath = /nbi/api/${nbi.version} +server.port = 8080 # LOGGING -logging.level.=INFO +logging.level. = INFO # ONAP -onap.lcpCloudRegionId=RegionOne -onap.tenantId=6e97a2bd51d74f6db5671d8dc1517d82 -onap.cloudOwner=CloudOwner +onap.lcpCloudRegionId = RegionOne +onap.tenantId = 6e97a2bd51d74f6db5671d8dc1517d82 +onap.cloudOwner = CloudOwner # NBI -nbi.url=http://localhost:${server.port}${server.contextPath} -nbi.callForVNF=false +nbi.url = http://localhost:${server.port}${server.contextPath} +nbi.callForVNF = false # SCHEDULER -scheduler.pollingDurationInMins=360 +scheduler.pollingDurationInMins = 360 +serviceOrder.schedule = 5000 +serviceOrder.initial = 1 +executionTask.schedule = 2000 +executionTask.initial = 1 # SDC -sdc.host=http://10.0.3.1:8080 -sdc.header.ecompInstanceId=demo -sdc.header.authorization=Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU= - +sdc.host = http://10.0.3.1:8080 +sdc.header.ecompInstanceId = demo +sdc.header.authorization = Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU= # AAI -aai.host=https://10.0.1.1:8443 -aai.header.authorization=Basic QUFJOkFBSQ== -aai.api.id=NBI -aai.header.transaction.id=808b54e3-e563-4144-a1b9-e24e2ed93d4f +aai.host = https://10.0.1.1:8443 +aai.header.authorization = Basic QUFJOkFBSQ== +aai.api.id = NBI +aai.header.transaction.id = 808b54e3-e563-4144-a1b9-e24e2ed93d4f # SO -so.host=http://10.0.5.1:8080 -so.header.authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== -so.api.id=SO -so.owning.entity.id=6b5b6b70-4e9a-4f6f-8b7b-cbd7cf990c6e -so.owning.entity.name=OE-generic -so.project.name=Project-generic + +so.host = http://10.0.5.1:8080 +so.header.authorization = Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== +so.api.id = SO +so.owning.entity.id = 6b5b6b70-4e9a-4f6f-8b7b-cbd7cf990c6e +so.owning.entity.name = OE-generic +so.project.name = Project-generic # MSB -msb.enabled=true -msb.discovery.host=msb_discovery -msb.discovery.port=10081 -msb.discovery.retry=5 -msb.discovery.retry_interval=5000 -msb.service.host= -msb.service.name=nbi -msb.service.custom_path= -msb.service.protocol=REST -msb.service.visual_range=1 -msb.service.enable_ssl=false +msb.enabled = true +msb.discovery.host = msb_discovery +msb.discovery.port = 10081 +msb.discovery.retry = 1 +msb.discovery.retry_interval = 5000 +msb.service.host = +msb.service.name = nbi +msb.service.custom_path = +msb.service.protocol = REST +msb.service.visual_range = 1 +msb.service.enable_ssl = false # MONGO -spring.data.mongodb.host=localhost -spring.data.mongodb.port=27017 -spring.data.mongodb.database=ServiceOrderDB +spring.data.mongodb.host = localhost +spring.data.mongodb.port = 27017 +spring.data.mongodb.database = ServiceOrderDB # MYSQL -spring.datasource.url=jdbc:mariadb://localhost:3306/nbi -spring.datasource.username=root -spring.datasource.password=secret -spring.datasource.testWhileIdle=true -spring.datasource.validationQuery=SELECT 1 -spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -spring.jpa.show-sql=false -spring.jpa.hibernate.ddl-auto=update -spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
\ No newline at end of file +spring.datasource.url = jdbc:mariadb://localhost:3306/nbi +spring.datasource.username = root +spring.datasource.password = secret +spring.datasource.testWhileIdle = true +spring.datasource.validationQuery = SELECT 1 +spring.datasource.driver-class-name = org.mariadb.jdbc.Driver +spring.jpa.show-sql = false +spring.jpa.hibernate.ddl-auto = update +spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
\ No newline at end of file diff --git a/src/test/java/joe.jpage b/src/test/java/joe.jpage new file mode 100644 index 0000000..0e28672 --- /dev/null +++ b/src/test/java/joe.jpage @@ -0,0 +1,10 @@ +java.io.File file = new java.io.File("/home/user/Source/starck-xsl/spec.json");
+String jsonStr = org.apache.commons.io.FileUtils.readFileToString(file);
+
+System.out.println(jsonStr);
+
+org.json.JSONObject json = new org.json.JSONObject(jsonStr);
+String xml = org.json.XML.toString(json);
+
+System.out.println(xml);
+
diff --git a/src/test/java/karate-config.js b/src/test/java/karate-config.js new file mode 100644 index 0000000..f67e555 --- /dev/null +++ b/src/test/java/karate-config.js @@ -0,0 +1,8 @@ +function() { + var config = { + nbiBaseUrl: 'http://localhost:8080/nbi/api/v3' + }; + karate.configure('connectTimeout', 5000); + karate.configure('readTimeout', 5000); + return config; +} diff --git a/src/test/java/org/onap/nbi/apis/ApiTest.java b/src/test/java/org/onap/nbi/apis/ApiTest.java deleted file mode 100644 index 696aa57..0000000 --- a/src/test/java/org/onap/nbi/apis/ApiTest.java +++ /dev/null @@ -1,1332 +0,0 @@ -/** - * Copyright (c) 2018 Orange - * - * 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. - */ -package org.onap.nbi.apis; - - -import com.github.tomakehurst.wiremock.WireMockServer; -import com.github.tomakehurst.wiremock.http.ResponseDefinition; -import com.github.tomakehurst.wiremock.stubbing.ListStubMappingsResult; -import com.github.tomakehurst.wiremock.stubbing.StubMapping; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Set; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; - -import org.junit.*; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.onap.nbi.apis.assertions.HubAssertions; -import org.onap.nbi.apis.assertions.ServiceCatalogAssertions; -import org.onap.nbi.apis.assertions.ServiceInventoryAssertions; -import org.onap.nbi.apis.assertions.ServiceOrderAssertions; -import org.onap.nbi.apis.hub.HubResource; -import org.onap.nbi.apis.hub.model.Subscriber; -import org.onap.nbi.apis.hub.model.Subscription; -import org.onap.nbi.apis.hub.service.SubscriptionService; -import org.onap.nbi.apis.servicecatalog.ServiceSpecificationResource; -import org.onap.nbi.apis.serviceinventory.ServiceInventoryResource; -import org.onap.nbi.apis.serviceorder.ServiceOrderResource; -import org.onap.nbi.apis.serviceorder.model.*; -import org.onap.nbi.apis.serviceorder.model.orchestrator.ExecutionTask; -import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository; -import org.onap.nbi.apis.serviceorder.repositories.ServiceOrderRepository; -import org.onap.nbi.apis.serviceorder.workflow.SOTaskProcessor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.embedded.LocalServerPort; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.ResponseEntity; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import static org.assertj.core.api.Assertions.assertThat; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) -public class ApiTest { - - @LocalServerPort - int randomServerPort; - - String realServerPort; - - static public WireMockServer wireMockServer = new WireMockServer(8091); - - @Autowired - ServiceSpecificationResource serviceSpecificationResource; - - @Autowired - ServiceInventoryResource serviceInventoryResource; - - @Autowired - ServiceOrderResource serviceOrderResource; - - @Autowired - HubResource hubResource; - - @Autowired - SubscriptionService subscriptionService; - - @Autowired - ServiceOrderRepository serviceOrderRepository; - - @Autowired - ExecutionTaskRepository executionTaskRepository; - - @Autowired - SOTaskProcessor SoTaskProcessor; - - @Mock - private RequestAttributes attrs; - - static Validator validator; - - @Value("${scheduler.pollingDurationInMins}") - private float pollingDurationInMins; - - @Before - public void before() { - MockHttpServletRequest request = new MockHttpServletRequest(); - RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); - } - - @BeforeClass - public static void setUp() throws Exception { - wireMockServer.start(); - ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - validator = factory.getValidator(); - } - - @AfterClass - public static void tearsDown() throws Exception { - wireMockServer.stop(); - - } - - @After - public void tearsDownUpPort() throws Exception { - executionTaskRepository.deleteAll(); - serviceOrderRepository.deleteAll(); - subscriptionService.deleteAll(); - wireMockServer.resetToDefaultMappings(); - - } - - - public ExecutionTask getExecutionTask(String orderItemId) { - for (ExecutionTask executionTask : executionTaskRepository.findAll()) { - if (executionTask.getOrderItemId().equalsIgnoreCase(orderItemId)) { - return executionTask; - } - - } - return null; - } - - private void removeWireMockMapping(String s) { - ListStubMappingsResult listStubMappingsResult = wireMockServer.listAllStubMappings(); - StubMapping mappingToDelete = null; - List<StubMapping> mappings = listStubMappingsResult.getMappings(); - for (StubMapping mapping : mappings) { - if (mapping.getRequest().getUrl().equals(s)) { - mappingToDelete = mapping; - } - - - } - - wireMockServer.removeStubMapping(mappingToDelete); - } - - private void changeWireMockResponse(String s,int statusCode, String bodyContent) { - ListStubMappingsResult listStubMappingsResult = wireMockServer.listAllStubMappings(); - ResponseDefinition responseDefinition = new ResponseDefinition(statusCode,bodyContent); - List<StubMapping> mappings = listStubMappingsResult.getMappings(); - for (StubMapping mapping : mappings) { - if (mapping.getRequest().getUrl().equals(s)) { - mapping.setResponse(responseDefinition); - } - } - } - - - - - // serviceCatalog - - - @Test - @Ignore - public void testServiceResourceGetCatalog() throws Exception { - - ResponseEntity<Object> resource = - serviceSpecificationResource.getServiceSpecification("1e3feeb0-8e36-46c6-862c-236d9c626439", null); - ServiceCatalogAssertions.assertGetServiceCatalog(resource); - - } - - @Test - public void testServiceCatalogGetResourceWithoutTosca() throws Exception { - - ResponseEntity<Object> resource = serviceSpecificationResource - .getServiceSpecification("1e3feeb0-8e36-46c6-862c-236d9c626439_withoutTosca", null); - ServiceCatalogAssertions.assertGetServiceCatalogWithoutTosca(resource); - - } - - @Test - public void testServiceCatalogFind() throws Exception { - - ResponseEntity<Object> resource = serviceSpecificationResource.findServiceSpecification(null); - ServiceCatalogAssertions.assertFindServiceCatalog(resource); - - } - - - @Test - public void testServiceCatalogFindWithFilter() throws Exception { - - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("fields", "name"); - ResponseEntity<Object> resource = serviceSpecificationResource.findServiceSpecification(params); - ServiceCatalogAssertions.assertFindServiceCatalogWIthFilter(resource); - - } - - // serviceInventory - - @Test - public void testServiceResourceGetInventory() throws Exception { - - String serviceName = "vFW"; - String serviceId = "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb"; - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("serviceSpecification.name", serviceName); - params.add("relatedParty.id", "6490"); - ResponseEntity<Object> resource = serviceInventoryResource.getServiceInventory(serviceId, params); - ServiceInventoryAssertions.assertServiceInventoryGet(resource); - - } - - @Test - public void testServiceResourceGetInventoryWithStatus() throws Exception { - - String serviceName = "AnsibleService"; - String serviceId = "405c8c00-44b9-4303-9f27-6797d22ca096"; - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("serviceSpecification.name", serviceName); - params.add("relatedParty.id", "6490"); - ResponseEntity<Object> resource = serviceInventoryResource.getServiceInventory(serviceId, params); - LinkedHashMap service = (LinkedHashMap) resource.getBody(); - assertThat(service.get("state")).isEqualTo("Active"); - - - } - - @Test - public void testServiceResourceGetInventoryWithoutRelationShipList() throws Exception { - - String serviceName = "vFW"; - String serviceId = "e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList"; - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("serviceSpecification.name", serviceName); - params.add("relatedParty.id", "6490"); - ResponseEntity<Object> resource = serviceInventoryResource.getServiceInventory(serviceId, params); - ServiceInventoryAssertions.assertServiceInventoryGetWithoutList(resource); - - } - - - @Test - public void testServiceResourceGetInventoryWithServiceSpecId() throws Exception { - - String serviceId = "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb"; - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("serviceSpecification.id", "1e3feeb0-8e36-46c6-862c-236d9c626439"); - params.add("relatedParty.id", "6490"); - ResponseEntity<Object> resource = serviceInventoryResource.getServiceInventory(serviceId, params); - ServiceInventoryAssertions.assertServiceInventoryGet(resource); - - } - - - @Test - public void testServiceInventoryFind() throws Exception { - - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - String serviceName = "vFW"; - params.add("serviceSpecification.name", serviceName); - params.add("relatedParty.id", "6490"); - - ResponseEntity<Object> resource = serviceInventoryResource.findServiceInventory(params); - ServiceInventoryAssertions.assertServiceInventoryFind(resource); - - } - - - @Test - public void testServiceInventoryFindWithServiceSpecId() throws Exception { - - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("serviceSpecification.id", "1e3feeb0-8e36-46c6-862c-236d9c626439"); - params.add("relatedParty.id", "6490"); - - ResponseEntity<Object> resource = serviceInventoryResource.findServiceInventory(params); - ServiceInventoryAssertions.assertServiceInventoryFind(resource); - - } - - - @Test - public void testServiceInventoryFindWithoutParameter() throws Exception { - - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("relatedParty.id", "6490"); - - ResponseEntity<Object> resource = serviceInventoryResource.findServiceInventory(params); - ServiceInventoryAssertions.assertServiceInventoryFindWithoutParameter(resource); - - } - - @Test - public void testCreateServiceOrderResource() throws Exception { - - ResponseEntity<Object> serviceOrder = serviceOrderResource - .createServiceOrder(ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD), null, null); - assertThat(serviceOrder.getStatusCodeValue()).isEqualTo(201); - ServiceOrder body = (ServiceOrder) serviceOrder.getBody(); - assertThat(body.getId()).isNotNull(); - assertThat(body.getState()).isEqualTo(StateType.ACKNOWLEDGED); - - - } - - @Test - public void testCheckServiceOrder() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.ACKNOWLEDGED); - - } - - - @Test - public void testCheckServiceOrderWithUnknownSverviceSpecId() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.getService().getServiceSpecification().setId("toto"); - } - - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("102"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("serviceSpecification.id"); - } - } - - @Test - public void testCheckServiceOrderWithGenericCustomer() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - testServiceOrder.setRelatedParty(new ArrayList<>()); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.ACKNOWLEDGED); - - } - - - @Test - public void testCheckServiceOrderWithoutRelatedParty() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - testServiceOrder.setRelatedParty(null); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.ACKNOWLEDGED); - - - } - - @Test - public void testCheckServiceOrderWithUnKnownCustomer() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - List<RelatedParty> customers = new ArrayList<>(); - RelatedParty customer = new RelatedParty(); - customer.setId("new"); - customer.setRole("ONAPcustomer"); - customer.setName("romain"); - customers.add(customer); - testServiceOrder.setRelatedParty(customers); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.ACKNOWLEDGED); - - } - - @Test - public void testCheckServiceOrderInDeleteWithNoServiceId() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.DELETE); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.getService().setId(null); - } - - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("101"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("service.id"); - } - } - - - @Test - public void testCheckServiceOrderInModifyWithNoServiceId() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.MODIFY); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.getService().setId(null); - } - - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("101"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("service.id"); - } - } - - @Test - public void testCheckServiceOrderInAddWithServiceId() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.getService().setId("toto"); - } - - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("103"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("service.id"); - } - } - - @Test - public void testCheckServiceOrderWithUnKnownCustomerInChange() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.DELETE); - List<RelatedParty> customers = new ArrayList<>(); - RelatedParty customer = new RelatedParty(); - customer.setId("new"); - customer.setRole("ONAPcustomer"); - customer.setName("romain"); - customers.add(customer); - testServiceOrder.setRelatedParty(customers); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - assertThat(serviceOrderChecked.getOrderMessage().size()).isGreaterThan(0); - assertThat(serviceOrderChecked.getOrderMessage().get(0).getCode()).isEqualTo("104"); - assertThat(serviceOrderChecked.getOrderMessage().get(0).getField()).isEqualTo("relatedParty.id"); - } - - - - @Test - public void testCheckServiceOrderWithCustomerAAINotResponding() throws Exception { - - removeWireMockMapping("/aai/v11/business/customers/customer/new"); - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - List<RelatedParty> customers = new ArrayList<>(); - RelatedParty customer = new RelatedParty(); - customer.setId("new"); - customer.setRole("ONAPcustomer"); - customer.setName("romain"); - customers.add(customer); - testServiceOrder.setRelatedParty(customers); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - - assertThat(serviceOrderChecked.getOrderMessage().size()).isGreaterThan(0); - assertThat(serviceOrderChecked.getOrderMessage().get(0).getCode()).isEqualTo("501"); - assertThat(serviceOrderChecked.getOrderMessage().get(0).getMessageInformation()).isEqualTo("Problem with AAI API"); - } - - - @Test - public void testCheckServiceOrderWithSDCNotResponding() throws Exception { - - removeWireMockMapping("/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439/metadata"); - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - List<RelatedParty> customers = new ArrayList<>(); - RelatedParty customer = new RelatedParty(); - customer.setId("new"); - customer.setRole("ONAPcustomer"); - customer.setName("romain"); - customers.add(customer); - testServiceOrder.setRelatedParty(customers); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("102"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("serviceSpecification.id"); - } - } - - - - - @Test - public void testCheckServiceOrderWithPutServiceAAINotResponding() throws Exception { - - removeWireMockMapping("/aai/v11/business/customers/customer/new/service-subscriptions/service-subscription/vFW"); - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - List<RelatedParty> customers = new ArrayList<>(); - RelatedParty customer = new RelatedParty(); - customer.setId("new"); - customer.setRole("ONAPcustomer"); - customer.setName("romain"); - customers.add(customer); - testServiceOrder.setRelatedParty(customers); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - } - - - @Test - public void testCheckServiceOrderDelete() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.DELETE); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.setState(StateType.ACKNOWLEDGED); - } - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.ACKNOWLEDGED); - - } - - @Test - public void testCheckServiceOrderDeleteRejected() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.DELETE); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.getService().setId("no_response"); - - } - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("106"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("service.id"); - } - } - - @Test - public void testCheckServiceOrderNoChange() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.DELETE); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.setAction(ActionType.NOCHANGE); - } - - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - } - - } - - - - @Test - public void testCheckServiceOrderNoChangeAndDelete() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.DELETE); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - serviceOrderItem.setAction(ActionType.NOCHANGE); - } - serviceOrderItem.setState(StateType.ACKNOWLEDGED); - } - - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.ACKNOWLEDGED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - } - } - - - @Test - public void testCheckServiceOrderDeleteWithKoServiceSpecId() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.DELETE); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.getService().getServiceSpecification().setId("undefined"); - } - - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.REJECTED); - } - } - - - - - @Test - public void testCheckServiceOrderRejected() throws Exception { - - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrderRejected(); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - serviceOrderResource.scheduleCheckServiceOrders(); - - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); - - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if(serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("102"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("serviceSpecification.id"); - } - } - } - - @Test - public void validateServiceOrderBeanWithAnnotation() { - ServiceOrder serviceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - Set violations = validator.validate(serviceOrder); - assertThat(violations).isEmpty(); - - ServiceOrderItem item = new ServiceOrderItem(); - item.setAction(ActionType.DELETE); - item.setService(new Service()); - serviceOrder.addOrderItemItem(item); - - violations = validator.validate(serviceOrder); - assertThat(violations).isNotEmpty(); - - ServiceOrder serviceOrder2 = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - serviceOrder2.getOrderItem().get(0).getService().getServiceSpecification().setId(""); - serviceOrder2.getOrderItem().get(1).getService().getServiceSpecification().setId(" "); - - violations = validator.validate(serviceOrder2); - assertThat(violations).isNotEmpty(); - assertThat(violations.size()).isEqualTo(2); - - } - - - - @Test - public void testFindAndGetServiceOrder() throws Exception { - - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - for (ServiceOrderItem serviceOrderItem : testServiceOrder.getOrderItem()) { - serviceOrderItem.setState(StateType.ACKNOWLEDGED); - } - testServiceOrder.setExternalId("extid1"); - testServiceOrder.setOrderDate(new Date()); - testServiceOrder.setState(StateType.ACKNOWLEDGED); - testServiceOrder.setDescription("toto"); - testServiceOrder.setId("test"); - serviceOrderRepository.save(testServiceOrder); - - - ServiceOrder testServiceOrder2 = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); - testServiceOrder2.setState(StateType.ACKNOWLEDGED); - testServiceOrder2.setDescription("toto"); - testServiceOrder2.setId("test2"); - testServiceOrder2.setExternalId("extid2"); - testServiceOrder2.setOrderDate(new Date()); - - serviceOrderRepository.save(testServiceOrder2); - - - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("fields", "id"); - - ResponseEntity<Object> serviceOrdersResponse = serviceOrderResource.findServiceOrder(params); - ArrayList serviceOrders = (ArrayList) serviceOrdersResponse.getBody(); - assertThat(serviceOrders.size()).isEqualTo(2); - - params.add("externalId", "extid1"); - params.add("state", "acknowledged"); - - serviceOrdersResponse = serviceOrderResource.findServiceOrder(params); - serviceOrders = (ArrayList) serviceOrdersResponse.getBody(); - assertThat(serviceOrders.size()).isEqualTo(1); - - MultiValueMap<String, String> paramsDate = new LinkedMultiValueMap<>(); - paramsDate.add("orderDate.gt", "2017-01-01T00:00:00.000Z"); - paramsDate.add("orderDate.lt", "2030-01-01T00:00:00.000Z"); - paramsDate.add("offset", "0"); - paramsDate.add("limit", "2"); - - serviceOrdersResponse = serviceOrderResource.findServiceOrder(paramsDate); - serviceOrders = (ArrayList) serviceOrdersResponse.getBody(); - assertThat(serviceOrders.size()).isEqualTo(2); - - - ResponseEntity<Object> serviceOrderResponse = - serviceOrderResource.getServiceOrder("test2", new LinkedMultiValueMap<>()); - ServiceOrder serviceOrder = (ServiceOrder) serviceOrderResponse.getBody(); - assertThat(serviceOrder).isNotNull(); - } - - - - @Test - public void testExecutionTaskSuccess() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - ExecutionTask executionTaskB; - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - - executionTaskB = getExecutionTask("B"); - assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); - executionTaskA = getExecutionTask("A"); - assertThat(executionTaskA).isNull(); - - SoTaskProcessor.processOrderItem(executionTaskB); - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - - - } - - @Test - public void testE2EExecutionTaskSuccess() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - ExecutionTask executionTaskB; - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - - executionTaskB = getExecutionTask("B"); - assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); - executionTaskA = getExecutionTask("A"); - assertThat(executionTaskA).isNull(); - - SoTaskProcessor.processOrderItem(executionTaskB); - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - - - } - - @Test - public void testExecutionTaskDeleteSuccess() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.DELETE); - ExecutionTask executionTaskB; - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - - executionTaskB = getExecutionTask("B"); - assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); - executionTaskA = getExecutionTask("A"); - assertThat(executionTaskA).isNull(); - - SoTaskProcessor.processOrderItem(executionTaskB); - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - - - } - - @Test - public void testE2EExecutionTaskDeleteSuccess() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.DELETE); - ExecutionTask executionTaskB; - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - - executionTaskB = getExecutionTask("B"); - assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); - executionTaskA = getExecutionTask("A"); - assertThat(executionTaskA).isNull(); - - SoTaskProcessor.processOrderItem(executionTaskB); - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - - - } - - - @Test - public void testExecutionTaskFailed() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - - removeWireMockMapping("/onap/so/infra/orchestrationRequests/v7/requestId"); - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - executionTaskA = getExecutionTask("A"); - Date createDate = executionTaskA.getCreateDate(); - assertThat(executionTaskA.getLastAttemptDate().getTime()> createDate.getTime()).isTrue(); - - changeCreationDate(executionTaskA); - SoTaskProcessor.processOrderItem(executionTaskA); - - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - - } - - private void changeCreationDate(ExecutionTask executionTaskA) { - Calendar cal = Calendar.getInstance(); - cal.setTime(executionTaskA.getCreateDate()); - cal.add(Calendar.SECOND, -30); - executionTaskA.setCreateDate(cal.getTime()); - } - - - @Test - public void testE2EExecutionTaskFailed() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - - removeWireMockMapping("/onap/so/infra/e2eServiceInstances/v3/serviceId/operations/operationId"); - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - executionTaskA = getExecutionTask("A"); - assertThat(executionTaskA.getLastAttemptDate().getTime()>executionTaskA.getCreateDate().getTime()).isTrue(); - changeCreationDate(executionTaskA); - SoTaskProcessor.processOrderItem(executionTaskA); - - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - - } - - @Test - public void testExecutionTaskFailedNoSoResponse() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - - removeWireMockMapping("/onap/so/infra/serviceInstantiation/v7/serviceInstances/"); - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - - - } - - @Test - public void testExecutionTaskFailedNoSoAndStatusResponse() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - - removeWireMockMapping("/onap/so/infra/serviceInstantiation/v7/serviceInstances/"); - removeWireMockMapping("/onap/so/infra/orchestrationRequests/v7/requestId"); - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - } - - @Test - public void testE2EExecutionTaskFailedNoSoAndStatusResponse() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - - removeWireMockMapping("/onap/so/infra/e2eServiceInstances/v3"); - removeWireMockMapping("/onap/so/infra/e2eServiceInstances/v3/serviceId/operations/operationId"); - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - } - - - @Test - public void testExecutionTaskFailedBadRequestSo() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.ADD); - - - changeWireMockResponse("/onap/so/infra/serviceInstantiation/v7/serviceInstances/",400,"\"serviceException\": {\n" - + " \"messageId\": \"SVC0002\",\n" - + " \"text\": \"Error parsing request. org.openecomp.mso.apihandler.common.ValidationException: serviceInstance already existsd\"\n" - + " }"); - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if(serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("105"); - assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("service.name"); - } - } - - } - - - @Test - public void testExecutionTaskModifySuccess() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.MODIFY); - ExecutionTask executionTaskB; - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - //assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS_MODIFY_ITEM_TO_CREATE); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - SoTaskProcessor.processOrderItem(executionTaskA); - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - - executionTaskB = getExecutionTask("B"); - assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); - executionTaskA = getExecutionTask("A"); - assertThat(executionTaskA).isNull(); - - SoTaskProcessor.processOrderItem(executionTaskB); - SoTaskProcessor.processOrderItem(executionTaskB); - - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - } - - - - - @Test - public void testExecutionTaskModifyFailed() throws Exception { - - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, - executionTaskRepository, ActionType.MODIFY); - ExecutionTask executionTaskB; - removeWireMockMapping("/onap/so/infra/orchestrationRequests/v7/requestId"); - - - SoTaskProcessor.processOrderItem(executionTaskA); - ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - if (serviceOrderItem.getId().equals("A")) { - //assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS_MODIFY_REQUEST_DELETE_SEND); - } else { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); - } - } - executionTaskA = getExecutionTask("A"); - assertThat(executionTaskA.getLastAttemptDate().getTime()>executionTaskA.getCreateDate().getTime()).isTrue(); - changeCreationDate(executionTaskA); - SoTaskProcessor.processOrderItem(executionTaskA); - - serviceOrderChecked = serviceOrderRepository.findOne("test"); - assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); - for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { - assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); - - } - - assertThat(executionTaskRepository.count()).isEqualTo(0); - - } - - // hub - - @Test - public void testFindWhenNoSubscriber() throws Exception { - ResponseEntity<Object> findResponseEntity = hubResource.findSubscribers(new LinkedMultiValueMap<>()); - assertThat(findResponseEntity.getStatusCodeValue()).isEqualTo(200); - ArrayList subscribers = (ArrayList) findResponseEntity.getBody(); - assertThat(subscribers.size()).isEqualTo(0); - } - - @Test - public void testSubscriberCreation() throws Exception { - ResponseEntity<Subscriber> firstCreationResponseEntity = hubResource - .createEventSubscription(HubAssertions.createServiceOrderCreationSubscription()); - assertThat(firstCreationResponseEntity.getStatusCodeValue()).isEqualTo(201); - assertThat(firstCreationResponseEntity.getHeaders().getLocation()).isNotNull(); - assertThat(subscriptionService.countSubscription()).isEqualTo(1); - } - - @Test - public void testCreationAndFindSubscriber() throws Exception { - ResponseEntity<Subscriber> firstCreationResponseEntity = hubResource - .createEventSubscription(HubAssertions.createServiceOrderCreationSubscription()); - ResponseEntity<Object> findResponseEntity = hubResource.findSubscribers(new LinkedMultiValueMap<>()); - ArrayList subscribers = (ArrayList) findResponseEntity.getBody(); - assertThat(subscribers.size()).isEqualTo(1); - } - - @Test - public void testCreationAndGetByIdSubscriber() throws Exception { - ResponseEntity<Subscriber> createResponseEntity = hubResource - .createEventSubscription(HubAssertions.createServiceOrderCreationSubscription()); - String resourceId = createResponseEntity.getHeaders().getLocation().getPath().substring(1); - ResponseEntity<Subscription> getResponseEntity = hubResource.getSubscription(resourceId); - assertThat(getResponseEntity.getStatusCodeValue()).isEqualTo(200); - assertThat(getResponseEntity.getBody()).isInstanceOf(Subscription.class); - } - - @Test - public void testMultiCreationAndFindSubscriber() throws Exception { - hubResource.createEventSubscription(HubAssertions.createServiceOrderCreationSubscription()); - hubResource.createEventSubscription(HubAssertions.createServiceOrderStateChangeSubscription()); - hubResource.createEventSubscription(HubAssertions.createServiceOrderItemStateChangeSubscription()); - - ResponseEntity<Object> findAllResponseEntity = hubResource.findSubscribers(new LinkedMultiValueMap<>()); - ArrayList subscribers = (ArrayList) findAllResponseEntity.getBody(); - assertThat(subscribers.size()).isEqualTo(3); - } - - @Test - public void testMultiCreationAndFindWithFilteringSubscriber() throws Exception { - hubResource.createEventSubscription(HubAssertions.createServiceOrderCreationSubscription()); - hubResource.createEventSubscription(HubAssertions.createServiceOrderStateChangeSubscription()); - hubResource.createEventSubscription(HubAssertions.createServiceOrderItemStateChangeSubscription()); - - MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); - params.add("query.eventType", "ServiceOrderCreationNotification"); - ResponseEntity<Object> findWithFilterResponseEntity = hubResource.findSubscribers(params); - ArrayList subscribers = (ArrayList) findWithFilterResponseEntity.getBody(); - assertThat(subscribers.size()).isEqualTo(1); - } - - @Test - public void testSubscriberDeletion() throws Exception { - ResponseEntity<Subscriber> createResponseEntity = hubResource - .createEventSubscription(HubAssertions.createServiceOrderCreationSubscription()); - String resourceId = createResponseEntity.getHeaders().getLocation().getPath().substring(1); - - ResponseEntity<Object> findResponseEntity = hubResource.findSubscribers(new LinkedMultiValueMap<>()); - ArrayList subscribers = (ArrayList) findResponseEntity.getBody(); - assertThat(subscribers.size()).isEqualTo(1); - - hubResource.deleteSubscription(resourceId); - - findResponseEntity = hubResource.findSubscribers(new LinkedMultiValueMap<>()); - subscribers = (ArrayList) findResponseEntity.getBody(); - assertThat(subscribers).isEmpty(); - } -} diff --git a/src/test/java/org/onap/nbi/apis/StatusResourceTest.java b/src/test/java/org/onap/nbi/apis/StatusResourceTest.java deleted file mode 100644 index 9b80745..0000000 --- a/src/test/java/org/onap/nbi/apis/StatusResourceTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2018 Orange - * - * 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. - */ -package org.onap.nbi.apis; - - -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.onap.nbi.apis.status.StatusResource; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.test.context.junit4.SpringRunner; -import static org.assertj.core.api.Assertions.assertThat; - - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class StatusResourceTest { - - @Autowired - StatusResource statusResource; - - @Value("${server.contextPath}") - String contextPath; - - @Value("${nbi.version}") - String version; - - private MockHttpServletRequest request; - - @Before - public void setup() { - request = new MockHttpServletRequest(); - request.setRequestURI(contextPath); - } - - @Test - public void testHealthCheck() { - ResponseEntity<Object> response = statusResource.status(request); - assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); - ObjectNode status = (ObjectNode) response.getBody(); - assertThat(status.get("name").textValue()).isEqualTo("nbi"); - assertThat(status.get("status").toString()).isEqualTo("OK"); - assertThat(status.get("version").textValue()).isEqualTo(version); - } -} diff --git a/src/test/java/org/onap/nbi/apis/assertions/HubAssertions.java b/src/test/java/org/onap/nbi/apis/assertions/HubAssertions.java deleted file mode 100644 index f2b72f8..0000000 --- a/src/test/java/org/onap/nbi/apis/assertions/HubAssertions.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2018 Orange - * - * 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. - */ -package org.onap.nbi.apis.assertions; - -import org.onap.nbi.apis.hub.model.Event; -import org.onap.nbi.apis.hub.model.EventType; -import org.onap.nbi.apis.hub.model.Subscription; - -import java.util.Date; -import java.util.UUID; - -public class HubAssertions { - - public static Subscription createServiceOrderCreationSubscription(){ - Subscription subscription = new Subscription(); - subscription.setId("id"); - subscription.setCallback("http://localhost:8080/test"); - subscription.setQuery("eventType = ServiceOrderCreationNotification"); - return subscription; - } - - public static Subscription createServiceOrderStateChangeSubscription(){ - Subscription subscription = new Subscription(); - subscription.setId("id"); - subscription.setCallback("http://localhost/test"); - subscription.setQuery("eventType = ServiceOrderStateChangeNotification"); - return subscription; - } - - public static Subscription createServiceOrderItemStateChangeSubscription(){ - Subscription subscription = new Subscription(); - subscription.setId("id"); - subscription.setCallback("http://localhost/test"); - subscription.setQuery("eventType = ServiceOrderItemStateChangeNotification"); - return subscription; - } - - public static Event createFakeEvent() { - Event event = new Event(); - event.setEventId(UUID.randomUUID().toString()); - event.setEventDate(new Date()); - event.setEventType(EventType.SERVICE_ORDER_CREATION.value()); - return event; - } -} diff --git a/src/test/java/org/onap/nbi/apis/assertions/ServiceCatalogAssertions.java b/src/test/java/org/onap/nbi/apis/assertions/ServiceCatalogAssertions.java deleted file mode 100644 index 3789c8f..0000000 --- a/src/test/java/org/onap/nbi/apis/assertions/ServiceCatalogAssertions.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Copyright (c) 2018 Orange - * - * 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. - */ -package org.onap.nbi.apis.assertions; - - -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import static org.assertj.core.api.Assertions.assertThat; - - -public class ServiceCatalogAssertions { - - - public static void assertGetServiceCatalog(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.OK); - LinkedHashMap service = (LinkedHashMap) resource.getBody(); - assertThat(service.get("id")).isEqualTo("1e3feeb0-8e36-46c6-862c-236d9c626439"); - assertThat(service.get("name")).isEqualTo("vFW"); - assertThat(service.get("invariantUUID")).isEqualTo("b58a118e-eeb9-4f6e-bdca-e292f84d17df"); - assertThat(service.get("toscaModelURL")) - .isEqualTo("/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439/toscaModel"); - assertThat(service.get("distributionStatus")).isEqualTo("DISTRIBUTED"); - assertThat(service.get("version")).isEqualTo("2.0"); - assertThat(service.get("lifecycleStatus")).isEqualTo("CERTIFIED"); - assertThat(service.get("@type")).isEqualTo("ONAPservice"); - assertThat(((ArrayList) service.get("attachment")).size()).isEqualTo(5); - LinkedHashMap relatedParty = (LinkedHashMap) service.get("relatedParty"); - assertThat(relatedParty.get("name")).isEqualTo("Joni Mitchell"); - assertThat(relatedParty.get("role")).isEqualTo("lastUpdater"); - - - assertThat(((ArrayList) service.get("resourceSpecification")).size()).isEqualTo(2); - LinkedHashMap resource1 = (LinkedHashMap) ((ArrayList) service.get("resourceSpecification")).get(0); - assertThat(resource1.get("name")).isEqualTo("vFW-vSINK"); - assertThat(resource1.get("resourceInstanceName")).isEqualTo("vFW-vSINK 0"); - assertThat(resource1.get("resourceType")).isEqualTo("VF"); - assertThat(resource1.get("resourceInvariantUUID")).isEqualTo("18b90934-aa82-456f-938e-e74a07a426f3"); - assertThat(resource1.get("@type")).isEqualTo("ONAPresource"); - assertThat(resource1.get("modelCustomizationName")).isEqualTo("vFW-vSINK 0"); - - assertThat(((ArrayList) service.get("serviceSpecCharacteristic")).size()).isEqualTo(4); - ArrayList serviceSPecCharacteristics = (ArrayList) service.get("serviceSpecCharacteristic"); - for (Object serviceSPecCharacteristic : serviceSPecCharacteristics) { - LinkedHashMap serviceSPecCharacteristicMap = (LinkedHashMap) serviceSPecCharacteristic; - if (serviceSPecCharacteristicMap.get("name").toString().equals("cpus")) { - assertThat(serviceSPecCharacteristicMap.get("valueType")).isEqualTo("integer"); - assertThat(serviceSPecCharacteristicMap.get("@type")).isEqualTo("ONAPserviceCharacteristic"); - ArrayList serviceSpecCharacteristicValues = - (ArrayList) serviceSPecCharacteristicMap.get("serviceSpecCharacteristicValue"); - for (Object serviceSpecCharacteristicValue : serviceSpecCharacteristicValues) { - LinkedHashMap serviceSpecCharacteristicValueMap = (LinkedHashMap) serviceSpecCharacteristicValue; - if (serviceSpecCharacteristicValueMap.get("value").toString().equals("2")) { - assertThat(serviceSpecCharacteristicValueMap.get("isDefault")).isEqualTo(true); - assertThat(serviceSpecCharacteristicValueMap.get("valueType")).isEqualTo("integer"); - } else { - assertThat(serviceSpecCharacteristicValueMap.get("isDefault")).isEqualTo(false); - assertThat(serviceSpecCharacteristicValueMap.get("valueType")).isEqualTo("integer"); - } - } - } - } - - } - - - - - public static void assertGetServiceCatalogWithoutTosca(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.PARTIAL_CONTENT); - LinkedHashMap service = (LinkedHashMap) resource.getBody(); - assertThat(service.get("id")).isEqualTo("1e3feeb0-8e36-46c6-862c-236d9c626439"); - assertThat(service.get("name")).isEqualTo("vFW"); - assertThat(service.get("invariantUUID")).isEqualTo("b58a118e-eeb9-4f6e-bdca-e292f84d17df"); - assertThat(service.get("toscaModelURL")) - .isEqualTo("/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439toto/toscaModel"); - assertThat(service.get("distributionStatus")).isEqualTo("DISTRIBUTED"); - assertThat(service.get("version")).isEqualTo("2.0"); - assertThat(service.get("lifecycleStatus")).isEqualTo("CERTIFIED"); - assertThat(service.get("@type")).isEqualTo("ONAPservice"); - assertThat(((ArrayList) service.get("attachment")).size()).isEqualTo(5); - LinkedHashMap relatedParty = (LinkedHashMap) service.get("relatedParty"); - assertThat(relatedParty.get("name")).isEqualTo("Joni Mitchell"); - assertThat(relatedParty.get("role")).isEqualTo("lastUpdater"); - - - assertThat(((ArrayList) service.get("resourceSpecification")).size()).isEqualTo(2); - LinkedHashMap resource1 = (LinkedHashMap) ((ArrayList) service.get("resourceSpecification")).get(0); - assertThat(resource1.get("name")).isEqualTo("vFW-vSINK"); - assertThat(resource1.get("resourceInstanceName")).isEqualTo("vFW-vSINK 0"); - assertThat(resource1.get("resourceType")).isEqualTo("VF"); - assertThat(resource1.get("resourceInvariantUUID")).isEqualTo("18b90934-aa82-456f-938e-e74a07a426f3"); - assertThat(resource1.get("@type")).isEqualTo("ONAPresource"); - assertThat(resource1.get("modelCustomizationName")).isEqualTo("vFW-vSINK 0"); - assertThat(service.get("serviceSpecCharacteristic")).isNull(); - } - - - - - - - - - - - public static void assertFindServiceCatalog(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.OK); - ArrayList body = (ArrayList) resource.getBody(); - assertThat(body.size()).isEqualTo(21); - LinkedHashMap service1 = (LinkedHashMap) body.get(0); - assertThat(service1.get("id")).isEqualTo("446afaf6-79b5-420e-aff8-7551b00bb510"); - assertThat(service1.get("name")).isEqualTo("FreeRadius-service"); - assertThat(service1.get("invariantUUID")).isEqualTo("7e4781e8-6c6e-41c5-b889-6a321d5f2490"); - assertThat(service1.get("category")).isEqualTo("Network L4+"); - assertThat(service1.get("distributionStatus")).isEqualTo("DISTRIBUTED"); - assertThat(service1.get("version")).isEqualTo("1.0"); - assertThat(service1.get("lifecycleStatus")).isEqualTo("CERTIFIED"); - LinkedHashMap relatedParty = (LinkedHashMap) service1.get("relatedParty"); - assertThat(relatedParty.get("role")).isEqualTo("lastUpdater"); - } - - - - public static void assertFindServiceCatalogWIthFilter(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.OK); - ArrayList body = (ArrayList) resource.getBody(); - assertThat(body.size()).isEqualTo(21); - - - ObjectNode service1 = (ObjectNode) body.get(0); - assertThat(service1.get("id")).isNull(); - assertThat(service1.get("name").asText()).isEqualTo("FreeRadius-service"); - assertThat(service1.get("invariantUUID")).isNull(); - assertThat(service1.get("category")).isNull(); - assertThat(service1.get("distributionStatus")).isNull(); - assertThat(service1.get("version")).isNull(); - assertThat(service1.get("lifecycleStatus")).isNull(); - assertThat(service1.get("relatedParty")).isNull(); - } - -} - diff --git a/src/test/java/org/onap/nbi/apis/assertions/ServiceInventoryAssertions.java b/src/test/java/org/onap/nbi/apis/assertions/ServiceInventoryAssertions.java deleted file mode 100644 index f68b82f..0000000 --- a/src/test/java/org/onap/nbi/apis/assertions/ServiceInventoryAssertions.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright (c) 2018 Orange - * - * 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. - */ -package org.onap.nbi.apis.assertions; - - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import static org.assertj.core.api.Assertions.assertThat; - -public class ServiceInventoryAssertions { - - - - public static void assertServiceInventoryGet(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.OK); - LinkedHashMap service = (LinkedHashMap) resource.getBody(); - assertThat(service.get("id")).isEqualTo("e4688e5f-61a0-4f8b-ae02-a2fbde623bcb"); - assertThat(service.get("name")).isEqualTo("NewFreeRadius-service-instance-01"); - assertThat(service.get("hasStarted")).isEqualTo("yes"); - assertThat(service.get("type")).isEqualTo("service-instance"); - assertThat(service.get("@type")).isEqualTo("serviceONAP"); - LinkedHashMap relatedParty = (LinkedHashMap) service.get("relatedParty"); - assertThat(relatedParty.get("role")).isEqualTo("ONAPcustomer"); - assertThat(relatedParty.get("id")).isEqualTo("6490"); - LinkedHashMap serviceSpecification = (LinkedHashMap) service.get("serviceSpecification"); - assertThat(serviceSpecification.get("id")).isEqualTo("98d95267-5e0f-4531-abf8-f14b90031dc5"); - assertThat(serviceSpecification.get("invariantUUID")).isEqualTo("709d157b-52fb-4250-976e-7133dff5c347"); - assertThat(serviceSpecification.get("@type")).isEqualTo("ONAPservice"); - - - assertThat(((ArrayList) service.get("supportingResource")).size()).isEqualTo(2); - LinkedHashMap resource1 = (LinkedHashMap) ((ArrayList) service.get("supportingResource")).get(0); - assertThat(resource1.get("id")).isEqualTo("cb80fbb6-9aa7-4ac5-9541-e14f45de533e"); - assertThat(resource1.get("name")).isEqualTo("NewFreeRadius-VNF-instance-01"); - assertThat(resource1.get("status")).isEqualTo("PREPROV"); - assertThat(resource1.get("modelInvariantId")).isEqualTo("f5993703-977f-4346-a1c9-c1884f8cfd8d"); - assertThat(resource1.get("modelVersionId")).isEqualTo("902438f7-1e4c-492d-b7cc-8650e13b8aeb"); - assertThat(resource1.get("@referredType")).isEqualTo("ONAP resource"); - } - - - public static void assertServiceInventoryGetWithoutList(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.OK); - LinkedHashMap service = (LinkedHashMap) resource.getBody(); - assertThat(service.get("id")).isEqualTo("e4688e5f-61a0-4f8b-ae02-a2fbde623bcb"); - assertThat(service.get("name")).isEqualTo("NewFreeRadius-service-instance-01"); - assertThat(service.get("hasStarted")).isEqualTo("yes"); - assertThat(service.get("type")).isEqualTo("service-instance"); - assertThat(service.get("@type")).isEqualTo("serviceONAP"); - LinkedHashMap relatedParty = (LinkedHashMap) service.get("relatedParty"); - assertThat(relatedParty.get("role")).isEqualTo("ONAPcustomer"); - assertThat(relatedParty.get("id")).isEqualTo("6490"); - LinkedHashMap serviceSpecification = (LinkedHashMap) service.get("serviceSpecification"); - assertThat(serviceSpecification.get("id")).isEqualTo("98d95267-5e0f-4531-abf8-f14b90031dc5"); - assertThat(serviceSpecification.get("invariantUUID")).isEqualTo("709d157b-52fb-4250-976e-7133dff5c347"); - assertThat(serviceSpecification.get("@type")).isEqualTo("ONAPservice"); - - assertThat(((ArrayList) service.get("supportingResource")).size()).isEqualTo(0); - - } - - - - public static void assertServiceInventoryFind(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.OK); - ArrayList body = (ArrayList) resource.getBody(); - assertThat(body.size()).isEqualTo(1); - LinkedHashMap service1 = (LinkedHashMap) body.get(0); - assertThat(service1.get("id")).isEqualTo("e4688e5f-61a0-4f8b-ae02-a2fbde623bcb"); - assertThat(service1.get("name")).isEqualTo("NewFreeRadius-service-instance-01"); - LinkedHashMap relatedParty = (LinkedHashMap) service1.get("relatedParty"); - assertThat(relatedParty.get("role")).isEqualTo("ONAPcustomer"); - assertThat(relatedParty.get("id")).isEqualTo("6490"); - LinkedHashMap serviceSpecification = (LinkedHashMap) service1.get("serviceSpecification"); - assertThat(serviceSpecification.get("name")).isEqualTo("vFW"); - assertThat(serviceSpecification.get("id")).isEqualTo("98d95267-5e0f-4531-abf8-f14b90031dc5"); - } - - - public static void assertServiceInventoryFindWithoutParameter(ResponseEntity<Object> resource) { - assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.OK); - ArrayList body = (ArrayList) resource.getBody(); - assertThat(body.size()).isEqualTo(2); - LinkedHashMap service1 = (LinkedHashMap) body.get(0); - assertThat(service1.get("id")).isEqualTo("vfw-service-id"); - assertThat(service1.get("name")).isEqualTo("vfw-service-name"); - LinkedHashMap relatedParty = (LinkedHashMap) service1.get("relatedParty"); - assertThat(relatedParty.get("role")).isEqualTo("ONAPcustomer"); - assertThat(relatedParty.get("id")).isEqualTo("6490"); - LinkedHashMap serviceSpecification = (LinkedHashMap) service1.get("serviceSpecification"); - assertThat(serviceSpecification.get("name")).isEqualTo("vFW-service-2VF-based"); - assertThat(serviceSpecification.get("id")).isEqualTo("9vfw-service-modek-version-id"); - - - LinkedHashMap service2 = (LinkedHashMap) body.get(1); - assertThat(service2.get("id")).isEqualTo("e4688e5f-61a0-4f8b-ae02-a2fbde623bcb"); - assertThat(service2.get("name")).isEqualTo("NewFreeRadius-service-instance-01"); - relatedParty = (LinkedHashMap) service1.get("relatedParty"); - assertThat(relatedParty.get("role")).isEqualTo("ONAPcustomer"); - assertThat(relatedParty.get("id")).isEqualTo("6490"); - serviceSpecification = (LinkedHashMap) service2.get("serviceSpecification"); - assertThat(serviceSpecification.get("name")).isEqualTo("vFW"); - assertThat(serviceSpecification.get("id")).isEqualTo("98d95267-5e0f-4531-abf8-f14b90031dc5"); - - } - -} diff --git a/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderAssertions.java b/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderExecutionTaskAssertions.java index 6bd4bd0..6fea745 100644 --- a/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderAssertions.java +++ b/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderExecutionTaskAssertions.java @@ -41,7 +41,7 @@ import org.onap.nbi.apis.serviceorder.repositories.ServiceOrderRepository; import org.onap.nbi.apis.serviceorder.utils.JsonEntityConverter; -public class ServiceOrderAssertions { +public class ServiceOrderExecutionTaskAssertions { public static ServiceOrder createTestServiceOrderRejected() { ServiceOrder serviceOrder = new ServiceOrder(); diff --git a/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java b/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java deleted file mode 100644 index b2ebe17..0000000 --- a/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Copyright (c) 2018 Orange - * - * 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. - */ -package org.onap.nbi.apis.servicecatalog; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; - -import org.assertj.core.api.AbstractBooleanAssert; -import org.junit.Test; -import org.onap.nbi.exceptions.TechnicalException; -import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException; - - -public class ToscaInfosProcessorTest { - - final ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); // jackson databind - - ToscaInfosProcessor toscaInfosProcessor = new ToscaInfosProcessor(); - - - private LinkedHashMap parseToscaFile(String fileName) { - - File toscaFile = new File(fileName); - if (!toscaFile.exists()) { - throw new TechnicalException("unable to find file : " + fileName); - } - try { - return (LinkedHashMap) mapper.readValue(toscaFile, Object.class); - } catch (IOException e) { - throw new TechnicalException("Unable to parse tosca file : " + fileName); - - } catch (NullPointerException e) { - throw new TechnicalException("unable to find tosca file : " + fileName); - } - } - - - @Test - public void buildResponseWithToscaInfos() { - - ClassLoader classLoader = getClass().getClassLoader(); - File file = new File(classLoader.getResource("toscafile/service-TestNetwork-template.yml").getFile()); - List<LinkedHashMap> resources = new ArrayList<>(); - LinkedHashMap resource1 = new LinkedHashMap(); - resource1.put("id", "e2b12ac6-cbb6-4517-9c58-b846d1f68caf"); - resources.add(resource1); - LinkedHashMap toscaFile = parseToscaFile(file.getPath()); - LinkedHashMap response = new LinkedHashMap(); - response.put("resourceSpecification", resources); - toscaInfosProcessor.buildResponseWithToscaInfos((LinkedHashMap) toscaFile.get("topology_template"), response); - - resources = (List<LinkedHashMap>) response.get("resourceSpecification"); - assertNull(resources.get(0).get("modelCustomizationId")); - assertNull(resources.get(0).get("modelCustomizationName")); - - } - - @Test - public void buildResponseWithSdcToscaParser() { - - ClassLoader classLoader = getClass().getClassLoader(); - Path path = new File(classLoader.getResource("toscafile/service-Sdwanvpninfraservice-csar.csar").getFile()).toPath().toAbsolutePath(); - List<LinkedHashMap> resources = new ArrayList<>(); - LinkedHashMap resource1 = new LinkedHashMap(); - resource1.put("id", "7baa7742-3a13-4288-8330-868015adc340"); - resources.add(resource1); - LinkedHashMap resource2 = new LinkedHashMap(); - resource2.put("id", "81b9430b-8abe-45d6-8bf9-f41a8f5c735f"); - resources.add(resource2); - LinkedHashMap response = new LinkedHashMap(); - response.put("resourceSpecification", resources); - - try { - toscaInfosProcessor.buildResponseWithSdcToscaParser(path, response); - } - catch(SdcToscaParserException e) { - throw new TechnicalException("unable to build response from tosca csar using sdc-parser : " + path.toString()+" "+e.getMessage()); - } - resources = (List<LinkedHashMap>) response.get("resourceSpecification"); - List<LinkedHashMap> serviceSpecCharacteristic = new ArrayList<>(); - serviceSpecCharacteristic = (List<LinkedHashMap>) response.get("serviceSpecCharacteristic"); - assertThat(serviceSpecCharacteristic.get(0).get("name")).isEqualTo("sdwanconnectivity0_topology"); - assertThat(serviceSpecCharacteristic.get(1).get("valueType")).isEqualTo("string"); - assertThat(serviceSpecCharacteristic.get(0).get("required")).isEqualTo(true); - assertThat(serviceSpecCharacteristic.get(1).get("name")).isEqualTo("sdwanconnectivity0_name"); - assertThat(serviceSpecCharacteristic.get(1).get("valueType")).isEqualTo("string"); - assertThat(serviceSpecCharacteristic.get(1).get("required")).isEqualTo(true); - assertThat(resources.get(0).get("modelCustomizationId")).isEqualTo("94ec574b-2306-4cbd-8214-09662b040f73"); - assertThat(resources.get(1).get("modelCustomizationId")).isEqualTo("a7baba5d-6ac3-42b5-b47d-070841303ab1"); - - } - - @Test - public void buildResponseWithSdcToscaParserWithDefaultInputs() { - - ClassLoader classLoader = getClass().getClassLoader(); - Path path = new File(classLoader.getResource("toscafile/service-Sotnvpninfraservice-csar.csar").getFile()).toPath().toAbsolutePath(); - List<LinkedHashMap> resources = new ArrayList<>(); - LinkedHashMap resource1 = new LinkedHashMap(); - resource1.put("id", "218df3c3-50dd-4c26-9e36-4771387bb771"); - resources.add(resource1); - LinkedHashMap resource2 = new LinkedHashMap(); - resource2.put("id", "81b9430b-8abe-45d6-8bf9-f41a8f5c735f"); - resources.add(resource2); - LinkedHashMap response = new LinkedHashMap(); - response.put("resourceSpecification", resources); - - try { - toscaInfosProcessor.buildResponseWithSdcToscaParser(path, response); - } - catch(SdcToscaParserException e) { - throw new TechnicalException("unable to build response from tosca csar using sdc-parser : " + path.toString()+" "+e.getMessage()); - } - resources = (List<LinkedHashMap>) response.get("resourceSpecification"); - List<LinkedHashMap> serviceSpecCharacteristic = new ArrayList<>(); - serviceSpecCharacteristic = (List<LinkedHashMap>) response.get("serviceSpecCharacteristic"); - assertThat(resources.get(0).get("modelCustomizationId")).isEqualTo("b44071c8-04fd-4d6b-b6af-772cbfaa1129"); - assertThat(resources.get(1).get("modelCustomizationId")).isEqualTo("c3612284-6c67-4d8c-8b41-b699cc90e76d"); - assertThat(serviceSpecCharacteristic.get(12).get("serviceSpecCharacteristicValue")).isNull(); - assertThat(serviceSpecCharacteristic.get(13).get("serviceSpecCharacteristicValue")).isNotNull(); - } - - @Test - public void buildResponseWithSdcToscaParserwithMetaDataMisMatch() { - - ClassLoader classLoader = getClass().getClassLoader(); - Path path = new File(classLoader.getResource("toscafile/service-Sdwanvpninfraservice-csar.csar").getFile()).toPath().toAbsolutePath(); - List<LinkedHashMap> resources = new ArrayList<>(); - LinkedHashMap resource1 = new LinkedHashMap(); - resource1.put("id", "some bad resource id no in TOSCA CSAR"); - resources.add(resource1); - LinkedHashMap resource2 = new LinkedHashMap(); - resource2.put("id", "some bad resource id no in TOSCA CSAR"); - resources.add(resource2); - LinkedHashMap response = new LinkedHashMap(); - response.put("resourceSpecification", resources); - - try { - toscaInfosProcessor.buildResponseWithSdcToscaParser(path, response); - } - catch(SdcToscaParserException e) { - throw new TechnicalException("unable to build response from tosca csar using sdc-parser : " + path.toString()+" "+e.getMessage()); - } - resources = (List<LinkedHashMap>) response.get("resourceSpecification"); - List<LinkedHashMap> serviceSpecCharacteristic = new ArrayList<>(); - serviceSpecCharacteristic = (List<LinkedHashMap>) response.get("serviceSpecCharacteristic"); - assertThat(serviceSpecCharacteristic.get(0).get("name")).isEqualTo("sdwanconnectivity0_topology"); - assertThat(serviceSpecCharacteristic.get(1).get("valueType")).isEqualTo("string"); - assertThat(serviceSpecCharacteristic.get(0).get("required")).isEqualTo(true); - assertThat(serviceSpecCharacteristic.get(1).get("name")).isEqualTo("sdwanconnectivity0_name"); - assertThat(serviceSpecCharacteristic.get(1).get("valueType")).isEqualTo("string"); - assertThat(serviceSpecCharacteristic.get(1).get("required")).isEqualTo(true); - // Check that resources cannot be found in the TOSCA template - assertThat(resources.get(0).get("modelCustomizationId")).isNull(); - assertThat(resources.get(1).get("modelCustomizationId")).isNull(); - - } - @Test - public void buildResponseWithToscaInfosOk() { - - ClassLoader classLoader = getClass().getClassLoader(); - File file = new File(classLoader.getResource("toscafile/service-VfwService2vfBased-template.yml").getFile()); - List<LinkedHashMap> resources = new ArrayList<>(); - LinkedHashMap resource1 = new LinkedHashMap(); - resource1.put("id", "e2b12ac6-cbb6-4517-9c58-b846d1f68caf"); - resources.add(resource1); - LinkedHashMap toscaFile = parseToscaFile(file.getPath()); - LinkedHashMap response = new LinkedHashMap(); - response.put("resourceSpecification", resources); - toscaInfosProcessor.buildResponseWithToscaInfos((LinkedHashMap) toscaFile.get("topology_template"), response); - - ArrayList toscaInfos = (ArrayList) response.get("serviceSpecCharacteristic"); - assertThat(toscaInfos.size()).isEqualTo(4); - - for (Object toscaInfo : toscaInfos) { - LinkedHashMap info = (LinkedHashMap) toscaInfo; - if (((String) info.get("name")).equalsIgnoreCase("fortigate_image_url")) { - assertThat(info.get("name")).isEqualTo("fortigate_image_url"); - assertThat(info.get("description")).isNull(); - assertThat(info.get("valueType")).isEqualTo("string"); - assertThat(info.get("@type")).isEqualTo("ONAPserviceCharacteristic"); - assertThat(info.get("required")).isEqualTo(false); - assertThat(info.get("status")).isNull(); - assertThat(((ArrayList) info.get("serviceSpecCharacteristicValue")).size()).isEqualTo(0); - - } - - if (((String) info.get("name")).equalsIgnoreCase("flavor")) { - assertThat(info.get("name")).isEqualTo("flavor"); - assertThat(info.get("description")).isNull(); - assertThat(info.get("valueType")).isEqualTo("string"); - assertThat(info.get("@type")).isEqualTo("ONAPserviceCharacteristic"); - assertThat(info.get("required")).isNull(); - assertThat(info.get("status")).isNull(); - assertThat(((ArrayList) info.get("serviceSpecCharacteristicValue")).size()).isEqualTo(0); - - } - - if (((String) info.get("name")).equalsIgnoreCase("external_network_name")) { - assertThat(info.get("name")).isEqualTo("external_network_name"); - assertThat(info.get("description")).isNull(); - assertThat(info.get("valueType")).isEqualTo("string"); - assertThat(info.get("@type")).isEqualTo("ONAPserviceCharacteristic"); - assertThat(info.get("required")).isNull(); - assertThat(info.get("status")).isEqualTo("inactive"); - ; - assertThat(((ArrayList) info.get("serviceSpecCharacteristicValue")).size()).isEqualTo(0); - - } - - if (((String) info.get("name")).equalsIgnoreCase("cpus")) { - assertThat(info.get("name")).isEqualTo("cpus"); - assertThat(info.get("description")).isEqualTo("Number of CPUs for the server."); - assertThat(info.get("valueType")).isEqualTo("integer"); - assertThat(info.get("@type")).isEqualTo("ONAPserviceCharacteristic"); - assertThat(info.get("required")).isNull(); - assertThat(info.get("status")).isNull(); - ; - assertThat(((ArrayList) info.get("serviceSpecCharacteristicValue")).size()).isEqualTo(4); - ArrayList serviceSpecCharacteristicValues = (ArrayList) info.get("serviceSpecCharacteristicValue"); - - for (Object serviceSpecCharacteristicValue : serviceSpecCharacteristicValues) { - LinkedHashMap serviceSpecValue = (LinkedHashMap) serviceSpecCharacteristicValue; - if (((String) serviceSpecValue.get("value")).equalsIgnoreCase("1")) { - assertThat(serviceSpecValue.get("isDefault")).isEqualTo(false); - assertThat(serviceSpecValue.get("value")).isEqualTo("1"); - assertThat(serviceSpecValue.get("valueType")).isEqualTo("integer"); - } - if (((String) serviceSpecValue.get("value")).equalsIgnoreCase("2")) { - assertThat(serviceSpecValue.get("isDefault")).isEqualTo(true); - assertThat(serviceSpecValue.get("value")).isEqualTo("2"); - assertThat(serviceSpecValue.get("valueType")).isEqualTo("integer"); - } - if (((String) serviceSpecValue.get("value")).equalsIgnoreCase("3")) { - assertThat(serviceSpecValue.get("isDefault")).isEqualTo(false); - assertThat(serviceSpecValue.get("value")).isEqualTo("3"); - assertThat(serviceSpecValue.get("valueType")).isEqualTo("integer"); - } - if (((String) serviceSpecValue.get("value")).equalsIgnoreCase("4")) { - assertThat(serviceSpecValue.get("isDefault")).isEqualTo(false); - assertThat(serviceSpecValue.get("value")).isEqualTo("4"); - assertThat(serviceSpecValue.get("valueType")).isEqualTo("integer"); - } - - } - - - } - - } - - - } -}
\ No newline at end of file diff --git a/src/test/java/org/onap/nbi/apis/ApiTestWithoutOnap.java b/src/test/java/org/onap/nbi/test/ApiTestWithoutOnap.java index 782c39a..6e57673 100644 --- a/src/test/java/org/onap/nbi/apis/ApiTestWithoutOnap.java +++ b/src/test/java/org/onap/nbi/test/ApiTestWithoutOnap.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.onap.nbi.apis; +package org.onap.nbi.test; import static org.assertj.core.api.Assertions.assertThat; @@ -22,7 +22,7 @@ import java.util.List; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.nbi.apis.assertions.ServiceOrderAssertions; +import org.onap.nbi.apis.assertions.ServiceOrderExecutionTaskAssertions; import org.onap.nbi.apis.servicecatalog.ServiceSpecificationResource; import org.onap.nbi.apis.serviceinventory.ServiceInventoryResource; import org.onap.nbi.apis.serviceorder.ServiceOrderResource; @@ -39,12 +39,17 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +@ActiveProfiles("test") @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@DirtiesContext(classMode= ClassMode.AFTER_CLASS) public class ApiTestWithoutOnap { @@ -88,7 +93,7 @@ public class ApiTestWithoutOnap { @Test public void testExecutionTaskWithoutOnap() throws Exception { - ExecutionTask executionTaskA = ServiceOrderAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, executionTaskRepository, ActionType.ADD); SoTaskProcessor.processOrderItem(executionTaskA); @@ -108,7 +113,7 @@ public class ApiTestWithoutOnap { @Test public void testCheckServiceOrderWithSDCNotResponding() throws Exception { - ServiceOrder testServiceOrder = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); + ServiceOrder testServiceOrder = ServiceOrderExecutionTaskAssertions.createTestServiceOrder(ActionType.ADD); List<RelatedParty> customers = new ArrayList<>(); RelatedParty customer = new RelatedParty(); customer.setId("new"); @@ -120,7 +125,7 @@ public class ApiTestWithoutOnap { testServiceOrder.setId("test"); serviceOrderRepository.save(testServiceOrder); - serviceOrderResource.scheduleCheckServiceOrders(); + serviceOrderResource.checkServiceOrder(testServiceOrder); ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.REJECTED); @@ -155,6 +160,7 @@ public class ApiTestWithoutOnap { ResponseEntity<Object> resource = serviceInventoryResource.getServiceInventory(serviceId, params); assertThat(resource.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR); + } diff --git a/src/test/java/org/onap/nbi/test/Context.java b/src/test/java/org/onap/nbi/test/Context.java new file mode 100644 index 0000000..bc35aa0 --- /dev/null +++ b/src/test/java/org/onap/nbi/test/Context.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2018 Orange + * + * 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. + */ +package org.onap.nbi.test; + +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.core.WireMockConfiguration; +import com.github.tomakehurst.wiremock.stubbing.StubMapping; +import java.util.List; +import org.onap.nbi.Application; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +public class Context { + + + public static ConfigurableApplicationContext nbiServer; + + public static WireMockServer wireMockServer; + + public static void startServers() throws Exception { + startWiremock(); + + // NBI + if (nbiServer == null) { + String[] args = new String[1]; + args[0] = "--spring.profiles.active=test"; + nbiServer = Application.run(args); + MockHttpServletRequest request = new MockHttpServletRequest(); + RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); + } + + } + + public static void startWiremock() { + // Wiremock + // If wireMockServer was previously created + if (wireMockServer != null) { + wireMockServer.stop(); + wireMockServer.resetToDefaultMappings(); + } else { + wireMockServer = + new WireMockServer( + WireMockConfiguration.wireMockConfig().port(8091).jettyStopTimeout(1000L)); + } + + wireMockServer.start(); + } + + public static void removeWireMockMapping(String mappingToBeRemoved) { + + if (mappingToBeRemoved == null) { + return; + } + + // Get current mappings + List<StubMapping> mappings = wireMockServer.listAllStubMappings().getMappings(); + + StubMapping mappingToDelete = null; + for (StubMapping mapping : mappings) { + if (mapping.getRequest().getUrl().equals(mappingToBeRemoved)) { + mappingToDelete = mapping; + } + } + + if (mappingToDelete != null) { + wireMockServer.removeStubMapping(mappingToDelete); + } + } + + public static void stopServers() throws Exception { + + // NBI + if (nbiServer != null) { // keep spring boot side alive for all tests including package + // 'mock' + nbiServer.close(); + } + + // Wiremock + if (wireMockServer != null) { + wireMockServer.stop(); + } + + } + +} diff --git a/src/test/java/org/onap/nbi/test/ExecutionTaskTest.java b/src/test/java/org/onap/nbi/test/ExecutionTaskTest.java new file mode 100644 index 0000000..56f2ba0 --- /dev/null +++ b/src/test/java/org/onap/nbi/test/ExecutionTaskTest.java @@ -0,0 +1,548 @@ +/** + * Copyright (c) 2018 Orange + * + * 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. + */ +package org.onap.nbi.test; + + +import static org.assertj.core.api.Assertions.assertThat; + +import com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult; +import com.github.tomakehurst.wiremock.http.ResponseDefinition; +import com.github.tomakehurst.wiremock.stubbing.StubMapping; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.validation.Validation; +import javax.validation.Validator; +import javax.validation.ValidatorFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.nbi.apis.assertions.ServiceOrderExecutionTaskAssertions; +import org.onap.nbi.apis.serviceorder.model.ActionType; +import org.onap.nbi.apis.serviceorder.model.ServiceOrder; +import org.onap.nbi.apis.serviceorder.model.ServiceOrderItem; +import org.onap.nbi.apis.serviceorder.model.StateType; +import org.onap.nbi.apis.serviceorder.model.orchestrator.ExecutionTask; +import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository; +import org.onap.nbi.apis.serviceorder.repositories.ServiceOrderRepository; +import org.onap.nbi.apis.serviceorder.workflow.SOTaskProcessor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@ActiveProfiles("test") +@DirtiesContext(classMode= ClassMode.AFTER_CLASS) +public class ExecutionTaskTest { + + @Autowired + ServiceOrderRepository serviceOrderRepository; + + @Autowired + ExecutionTaskRepository executionTaskRepository; + + @Autowired + SOTaskProcessor SoTaskProcessor; + + + static Validator validator; + + @Before + public void before() { + MockHttpServletRequest request = new MockHttpServletRequest(); + RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); + } + + @BeforeClass + public static void setUp() throws Exception { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + validator = factory.getValidator(); + Context.startWiremock(); + } + + @AfterClass + public static void tearsDown() throws Exception { + Context.stopServers(); + + } + + @After + public void tearsDownUpPort() throws Exception { + executionTaskRepository.deleteAll(); + serviceOrderRepository.deleteAll(); + Context.wireMockServer.resetToDefaultMappings(); + + } + + + public ExecutionTask getExecutionTask(String orderItemId) { + for (ExecutionTask executionTask : executionTaskRepository.findAll()) { + if (executionTask.getOrderItemId().equalsIgnoreCase(orderItemId)) { + return executionTask; + } + + } + return null; + } + + private void changeWireMockResponse(String s,int statusCode, String bodyContent) { + ListStubMappingsResult listStubMappingsResult = Context.wireMockServer.listAllStubMappings(); + ResponseDefinition responseDefinition = new ResponseDefinition(statusCode,bodyContent); + List<StubMapping> mappings = listStubMappingsResult.getMappings(); + for (StubMapping mapping : mappings) { + if (mapping.getRequest().getUrl().equals(s)) { + mapping.setResponse(responseDefinition); + } + } + } + + + + + + + @Test + public void testExecutionTaskSuccess() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + ExecutionTask executionTaskB; + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + + executionTaskB = getExecutionTask("B"); + assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); + executionTaskA = getExecutionTask("A"); + assertThat(executionTaskA).isNull(); + + SoTaskProcessor.processOrderItem(executionTaskB); + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + + + } + + @Test + public void testE2EExecutionTaskSuccess() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + ExecutionTask executionTaskB; + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + + executionTaskB = getExecutionTask("B"); + assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); + executionTaskA = getExecutionTask("A"); + assertThat(executionTaskA).isNull(); + + SoTaskProcessor.processOrderItem(executionTaskB); + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + + + } + + @Test + public void testExecutionTaskDeleteSuccess() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.DELETE); + ExecutionTask executionTaskB; + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + + executionTaskB = getExecutionTask("B"); + assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); + executionTaskA = getExecutionTask("A"); + assertThat(executionTaskA).isNull(); + + SoTaskProcessor.processOrderItem(executionTaskB); + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + + + } + + @Test + public void testE2EExecutionTaskDeleteSuccess() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.DELETE); + ExecutionTask executionTaskB; + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + + executionTaskB = getExecutionTask("B"); + assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); + executionTaskA = getExecutionTask("A"); + assertThat(executionTaskA).isNull(); + + SoTaskProcessor.processOrderItem(executionTaskB); + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + + + } + + + @Test + public void testExecutionTaskFailed() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + + Context.removeWireMockMapping("/onap/so/infra/orchestrationRequests/v7/requestId"); + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + executionTaskA = getExecutionTask("A"); + Date createDate = executionTaskA.getCreateDate(); + assertThat(executionTaskA.getLastAttemptDate().getTime()> createDate.getTime()).isTrue(); + + changeCreationDate(executionTaskA); + SoTaskProcessor.processOrderItem(executionTaskA); + + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + + } + + private void changeCreationDate(ExecutionTask executionTaskA) { + Calendar cal = Calendar.getInstance(); + cal.setTime(executionTaskA.getCreateDate()); + cal.add(Calendar.SECOND, -30); + executionTaskA.setCreateDate(cal.getTime()); + } + + + @Test + public void testE2EExecutionTaskFailed() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + + Context.removeWireMockMapping("/onap/so/infra/e2eServiceInstances/v3/serviceId/operations/operationId"); + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + executionTaskA = getExecutionTask("A"); + assertThat(executionTaskA.getLastAttemptDate().getTime()>executionTaskA.getCreateDate().getTime()).isTrue(); + changeCreationDate(executionTaskA); + SoTaskProcessor.processOrderItem(executionTaskA); + + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + + } + + @Test + public void testExecutionTaskFailedNoSoResponse() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + + Context.removeWireMockMapping("/onap/so/infra/serviceInstantiation/v7/serviceInstances/"); + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + + + } + + @Test + public void testExecutionTaskFailedNoSoAndStatusResponse() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + + Context.removeWireMockMapping("/onap/so/infra/serviceInstantiation/v7/serviceInstances/"); + Context.removeWireMockMapping("/onap/so/infra/orchestrationRequests/v7/requestId"); + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + } + + @Test + public void testE2EExecutionTaskFailedNoSoAndStatusResponse() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForE2EExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + + Context.removeWireMockMapping("/onap/so/infra/e2eServiceInstances/v3"); + Context.removeWireMockMapping("/onap/so/infra/e2eServiceInstances/v3/serviceId/operations/operationId"); + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + } + + + @Test + public void testExecutionTaskFailedBadRequestSo() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.ADD); + + + changeWireMockResponse("/onap/so/infra/serviceInstantiation/v7/serviceInstances/",400,"\"serviceException\": {\n" + + " \"messageId\": \"SVC0002\",\n" + + " \"text\": \"Error parsing request. org.openecomp.mso.apihandler.common.ValidationException: serviceInstance already existsd\"\n" + + " }"); + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if(serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getOrderItemMessage().size()).isEqualTo(1); + assertThat(serviceOrderItem.getOrderItemMessage().get(0).getCode()).isEqualTo("105"); + assertThat(serviceOrderItem.getOrderItemMessage().get(0).getField()).isEqualTo("service.name"); + } + } + + } + + + @Test + public void testExecutionTaskModifySuccess() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.MODIFY); + ExecutionTask executionTaskB; + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + //assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS_MODIFY_ITEM_TO_CREATE); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + SoTaskProcessor.processOrderItem(executionTaskA); + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + + executionTaskB = getExecutionTask("B"); + assertThat(executionTaskB.getReliedTasks()).isNullOrEmpty(); + executionTaskA = getExecutionTask("A"); + assertThat(executionTaskA).isNull(); + + SoTaskProcessor.processOrderItem(executionTaskB); + SoTaskProcessor.processOrderItem(executionTaskB); + + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.COMPLETED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.COMPLETED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + } + + + + + @Test + public void testExecutionTaskModifyFailed() throws Exception { + + ExecutionTask executionTaskA = ServiceOrderExecutionTaskAssertions.setUpBddForExecutionTaskSucess(serviceOrderRepository, + executionTaskRepository, ActionType.MODIFY); + ExecutionTask executionTaskB; + Context.removeWireMockMapping("/onap/so/infra/orchestrationRequests/v7/requestId"); + + + SoTaskProcessor.processOrderItem(executionTaskA); + ServiceOrder serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.INPROGRESS); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + if (serviceOrderItem.getId().equals("A")) { + //assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS); + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.INPROGRESS_MODIFY_REQUEST_DELETE_SEND); + } else { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.ACKNOWLEDGED); + } + } + executionTaskA = getExecutionTask("A"); + assertThat(executionTaskA.getLastAttemptDate().getTime()>executionTaskA.getCreateDate().getTime()).isTrue(); + changeCreationDate(executionTaskA); + SoTaskProcessor.processOrderItem(executionTaskA); + + serviceOrderChecked = serviceOrderRepository.findOne("test"); + assertThat(serviceOrderChecked.getState()).isEqualTo(StateType.FAILED); + for (ServiceOrderItem serviceOrderItem : serviceOrderChecked.getOrderItem()) { + assertThat(serviceOrderItem.getState()).isEqualTo(StateType.FAILED); + + } + + assertThat(executionTaskRepository.count()).isEqualTo(0); + + } + +}
\ No newline at end of file diff --git a/src/test/java/org/onap/nbi/test/KarateApiTest.java b/src/test/java/org/onap/nbi/test/KarateApiTest.java new file mode 100644 index 0000000..e5845f3 --- /dev/null +++ b/src/test/java/org/onap/nbi/test/KarateApiTest.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 Orange + * + * 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. + */ +package org.onap.nbi.test; + +import com.intuit.karate.junit4.Karate; +import cucumber.api.CucumberOptions; +import org.junit.AfterClass; +import org.junit.runner.RunWith; + +@RunWith(Karate.class) +@CucumberOptions(features = "src/test/resources/karatetest/features") +public class KarateApiTest { + + @AfterClass + public static void stop() throws Exception { + Context.stopServers(); + } + +} diff --git a/src/test/java/org/onap/nbi/apis/ServiceOrderRepositoryTest.java b/src/test/java/org/onap/nbi/test/ServiceOrderRepositoryTest.java index 9c030bd..11ed493 100644 --- a/src/test/java/org/onap/nbi/apis/ServiceOrderRepositoryTest.java +++ b/src/test/java/org/onap/nbi/test/ServiceOrderRepositoryTest.java @@ -13,11 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.onap.nbi.apis; +package org.onap.nbi.test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; + import java.util.List; import org.junit.Before; import org.junit.Test; @@ -27,10 +28,15 @@ import org.onap.nbi.apis.serviceorder.model.StateType; import org.onap.nbi.apis.serviceorder.repositories.ServiceOrderRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@DirtiesContext(classMode= ClassMode.AFTER_CLASS) +@ActiveProfiles("test") public class ServiceOrderRepositoryTest { @Autowired diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties deleted file mode 100644 index bcd8fb9..0000000 --- a/src/test/resources/application.properties +++ /dev/null @@ -1,76 +0,0 @@ -# -# Copyright (c) 2018 Orange -# -# 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. -# - -nbi.version=v3 - -# SERVER -server.contextPath=/nbi/api/${nbi.version} -server.port = 8080 - -# LOGGING -logging.level.org.onap.nbi=DEBUG - -# ONAP -onap.lcpCloudRegionId=RegionOne -onap.tenantId=31047205ce114b60833b23e400d6a535 -onap.cloudOwner=CloudOwner - -# NBI -nbi.url=http://localhost:${server.port}${server.contextPath} -nbi.callForVNF=false - -# SCHEDULER -scheduler.pollingDurationInMins=0.1 - -# SDC -sdc.host=http://127.0.0.1:8091 -sdc.header.ecompInstanceId=Rene -sdc.header.authorization=Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU= - -# AAI -aai.host=http://127.0.0.1:8091 -aai.header.authorization=Basic QUFJOkFBSQ== -aai.api.id=AAI -aai.header.transaction.id=808b54e3-e563-4144-a1b9-e24e2ed93d4f - -# SO -so.host=http://127.0.0.1:8091 -so.header.authorization= -so.api.id=SO -so.owning.entity.id=6b5b6b70-4e9a-4f6f-8b7b-cbd7cf990c6e -so.owning.entity.name=OE-generic -so.project.name=Project-generic - -# MSB -msb.enabled=false -msb.discovery.host=msb_discovery -msb.discovery.port=10081 -msb.discovery.retry=5 -msb.discovery.retry_interval=5000 -msb.service.host= -msb.service.name=nbi -msb.service.custom_path= -msb.service.protocol=REST -msb.service.visual_range=1 -msb.service.enable_ssl=false - -# H2 -spring.datasource.url=jdbc:h2:mem:~/db;DB_CLOSE_ON_EXIT=false -spring.datasource.username=sa -spring.datasource.password= -spring.datasource.driver-class-name=org.h2.Driver -spring.h2.console.enabled=true -spring.h2.console.path=/h2-console
\ No newline at end of file diff --git a/src/test/resources/karatetest/data/serviceOrder.json b/src/test/resources/karatetest/data/serviceOrder.json new file mode 100644 index 0000000..89cc6e8 --- /dev/null +++ b/src/test/resources/karatetest/data/serviceOrder.json @@ -0,0 +1,1026 @@ +[ + { + "id": "test", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test1", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "toto" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "toto" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test2", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test3", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": null, + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test4", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "new", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "romain" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test5", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test6", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "modify", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "modify", + "state": "active", + "service": { + "id": "null", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test7", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "id": "toto", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "id": "toto", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test8", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "new", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "romain" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "test", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "test", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test9", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test10", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "no_response", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "no_response", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test11", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "noChange", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "noChange", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test12", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "noChange", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test13", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "undefined" + } + } + }, + { + "id": "B", + "action": "delete", + "state": "active", + "service": { + "id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "state": "active", + "serviceSpecification": { + "id": "undefined" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test14", + "state": "acknowledged", + "externalId": "LudONAP001", + "priority": "1", + "description": "Ludo first ONAP order", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "333" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test15", + "state": "acknowledged", + "externalId": "extid1", + "priority": "1", + "description": "toto", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + }, + { + "id": "test16", + "state": "acknowledged", + "externalId": "extid2", + "priority": "1", + "description": "toto", + "category": "Consumer", + "requestedStartDate": "2019-01-23T12:34:56.123456789Z", + "requestedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@baseType": "toto", + "completionDateTime": "2019-01-23T12:34:56.123456789Z", + "expectedCompletionDate": "2019-01-23T12:34:56.123456789Z", + "@schemaLocation": "/tutu", + "orderRelationship": [ + { + "id": "test", + "href": "test", + "referredType": "test", + "type": "test" + } + ], + "relatedParty": [ + { + "id": "6490", + "role": "ONAPcustomer", + "referredType": "individual", + "name": "Jean Pontus" + } + ], + "orderItem": [ + { + "id": "A", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + } + }, + { + "id": "B", + "action": "add", + "state": "active", + "service": { + "state": "active", + "serviceSpecification": { + "id": "1e3feeb0-8e36-46c6-862c-236d9c626439" + } + }, + "orderItemRelationship": [ + { + "id": "A", + "type": "reliesOn" + } + ] + } + ] + } +] diff --git a/src/test/resources/karatetest/data/subscriber.json b/src/test/resources/karatetest/data/subscriber.json new file mode 100644 index 0000000..e7c08ad --- /dev/null +++ b/src/test/resources/karatetest/data/subscriber.json @@ -0,0 +1,17 @@ +[ + { + "id": "id", + "callback": "http://localhost:8080/test", + "query": "eventType = ServiceOrderCreationNotification" + }, + { + "id": "id", + "callback": "http://localhost/test", + "query": "eventType=ServiceOrderStateChangeNotification" + }, + { + "id": "id", + "callback": "http://localhost/test", + "query": "eventType=ServiceOrderItemStateChangeNotification" + } +]
\ No newline at end of file diff --git a/src/test/resources/karatetest/features/00--ServiceCatalog.feature b/src/test/resources/karatetest/features/00--ServiceCatalog.feature new file mode 100644 index 0000000..2edd420 --- /dev/null +++ b/src/test/resources/karatetest/features/00--ServiceCatalog.feature @@ -0,0 +1,38 @@ +# new feature +# Tags: optional + +Feature: Service Catalog + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); + +Scenario: testServiceCatalogGetResourceWithoutTosca +Given path 'serviceSpecification','1e3feeb0-8e36-46c6-862c-236d9c626439_withoutTosca' +When method get +Then status 206 +And match $ contains { id : '1e3feeb0-8e36-46c6-862c-236d9c626439' , name : 'vFW' , invariantUUID : 'b58a118e-eeb9-4f6e-bdca-e292f84d17df' , toscaModelURL : '/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439toto/toscaModel' , distributionStatus : 'DISTRIBUTED' , version : '2.0' , lifecycleStatus : 'CERTIFIED' , @type : 'ONAPservice' , attachment : '#array' , relatedParty : '#notnull' , resourceSpecification : '#array' } +And match $.relatedParty contains { name : 'Joni Mitchell', role : 'lastUpdater' } +And match $.resourceSpecification[0] contains { name : 'vFW-vSINK', resourceInstanceName : 'vFW-vSINK 0', resourceType : 'VF' , resourceInvariantUUID : '18b90934-aa82-456f-938e-e74a07a426f3' , @type : 'ONAPresource', modelCustomizationName : 'vFW-vSINK 0' } +And match $.resourceSpecification == '#[2]' +And match $.attachment == '#[5]' + +Scenario: findServiceCatalog +Given path 'serviceSpecification' +When method get +Then status 200 +And assert response.length == 21 +And match $[0] contains { id : '446afaf6-79b5-420e-aff8-7551b00bb510' , name : 'FreeRadius-service' , invariantUUID : '7e4781e8-6c6e-41c5-b889-6a321d5f2490' , category : 'Network L4+' , distributionStatus : 'DISTRIBUTED' , version : '1.0' , lifecycleStatus : 'CERTIFIED' } +And match $[0].relatedParty contains { role : 'lastUpdater' } + + + +Scenario: findServiceCatalogWithFilter +Given path 'serviceSpecification' +And params {fields:'name'} +When method get +Then status 200 +And assert response.length == 21 +And match $[0] contains { name : 'FreeRadius-service' } + diff --git a/src/test/resources/karatetest/features/01--ServiceInventory.feature b/src/test/resources/karatetest/features/01--ServiceInventory.feature new file mode 100644 index 0000000..2b657be --- /dev/null +++ b/src/test/resources/karatetest/features/01--ServiceInventory.feature @@ -0,0 +1,90 @@ +# new feature +# Tags: optional + +Feature: Service Inventory + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); + + +Scenario: testServiceResourceGetInventory +Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' +And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490'} +When method get +Then status 200 +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', hasStarted : 'yes', type : 'service-instance', @type : 'serviceONAP' } +And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } +And match $.supportingResource[0] contains { id : 'cb80fbb6-9aa7-4ac5-9541-e14f45de533e' , name : 'NewFreeRadius-VNF-instance-01' , status : 'PREPROV' , modelInvariantId : 'f5993703-977f-4346-a1c9-c1884f8cfd8d' , modelVersionId : '902438f7-1e4c-492d-b7cc-8650e13b8aeb' , @referredType : 'ONAP resource' } +And match $.supportingResource == '#[2]' + +Scenario: testServiceResourceGetInventoryWithStatus +Given url 'http://localhost:8080/nbi/api/v3/service/405c8c00-44b9-4303-9f27-6797d22ca096?serviceSpecification.name=AnsibleService&relatedParty.id=6490' +When method get +Then status 200 +And match $.state == 'Active' + +Scenario: testServiceResourceGetInventoryWithoutRelationShipList +Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList' +And params {serviceSpecification.name:'vFW',relatedParty.id:'6490'} +When method get +Then status 200 +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' , hasStarted : 'yes' , type : 'service-instance' , @type : 'serviceONAP' } +And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } +And match $.supportingResource == '#[0]' + +Scenario: testServiceResourceGetInventoryWithServiceSpecId +Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' +And params {serviceSpecification.id:'1e3feeb0-8e36-46c6-862c-236d9c626439', relatedParty.id:'6490'} +When method get +Then status 200 +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', hasStarted : 'yes', type : 'service-instance', @type : 'serviceONAP' } +And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } +And match $.supportingResource[0] contains { id : 'cb80fbb6-9aa7-4ac5-9541-e14f45de533e' , name : 'NewFreeRadius-VNF-instance-01' , status : 'PREPROV' , modelInvariantId : 'f5993703-977f-4346-a1c9-c1884f8cfd8d' , modelVersionId : '902438f7-1e4c-492d-b7cc-8650e13b8aeb' , @referredType : 'ONAP resource' } +And match $.supportingResource == '#[2]' + + +Scenario: testServiceInventoryFind +Given path 'service' +And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490' } +When method get +Then status 200 +And match $ == '#[1]' +And match $[0] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' } +And match $[0].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[0].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' } + +Scenario: testServiceInventoryFindWithServiceSpecId +Given path 'service' +And params {serviceSpecification.id : '1e3feeb0-8e36-46c6-862c-236d9c626439' , relatedParty.id : '6490'} +When method get +Then status 200 +And match $ == '#[1]' +And match $[0] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' } +And match $[0].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[0].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' } + +Scenario: testServiceInventoryFindWithoutParameter +Given path 'service' +And params {relatedParty.id:'6490'} +When method get +Then status 200 +And match $ == '#[2]' +And match $[0] contains { id : 'vfw-service-id' , name : 'vfw-service-name' } +And match $[0].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[0].serviceSpecification contains { name : 'vFW-service-2VF-based' , id : '9vfw-service-modek-version-id' } +And match $[1] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' } +And match $[1].relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $[1].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' } + + + + + + + + diff --git a/src/test/resources/karatetest/features/02--ServiceOrder.feature b/src/test/resources/karatetest/features/02--ServiceOrder.feature new file mode 100644 index 0000000..6e4b804 --- /dev/null +++ b/src/test/resources/karatetest/features/02--ServiceOrder.feature @@ -0,0 +1,398 @@ +# new feature +# Tags: optional + +Feature: Service order + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); +* def data = read('../data/serviceOrder.json') +* def sleep = function(){java.lang.Thread.sleep(5000)} + + +Scenario: testCreateServiceOrderResource +Given path 'serviceOrder' +And request data[0] +When method post +Then status 201 +And match $.id contains '#notnull' +And match $.state == 'acknowledged' +Given path 'serviceOrder','test' +When method delete +Then status 204 + +Scenario: testCheckServiceOrder +Given path 'serviceOrder' +And request data[0] +When method post +Then status 201 +Given path 'serviceOrder','test','test' +And request $ +When method put +Then status 201 +And match $.id == 'test' +And match $.state == 'acknowledged' +Given path 'serviceOrder','test' +When method get +Then status 200 +Given path 'serviceOrder','test' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithUnknownSverviceSpecId +Given path 'serviceOrder' +And request data[1] +When method post +Then status 201 +Given path 'serviceOrder','test','test1' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '102' , field : 'serviceSpecification.id' } +Given path 'serviceOrder','test1' +When method get +Then status 200 +Given path 'serviceOrder','test1' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithGenericCustomer +Given path 'serviceOrder' +And request data[2] +When method post +Then status 201 +Given path 'serviceOrder','test','test2' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test2' +When method get +Then status 200 +Given path 'serviceOrder','test2' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderWithoutRelatedParty +Given path 'serviceOrder' +And request data[3] +When method post +Then status 201 +Given path 'serviceOrder','test','test3' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test3' +When method get +Then status 200 +Given path 'serviceOrder','test3' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithUnKnownCustomer +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test4' +When method get +Then status 200 +Given path 'serviceOrder','test4' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderInDeleteWithNoServiceId +Given path 'serviceOrder' +And request data[5] +When method post +Then status 201 +Given path 'serviceOrder','test','test5' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '106' , field : 'service.id' } +Given path 'serviceOrder','test5' +When method get +Then status 200 +Given url 'http://localhost:8080/nbi/api/v3/serviceOrder/test5' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderInModifyWithNoServiceId +Given path 'serviceOrder' +And request data[6] +When method post +Then status 201 +Given path 'serviceOrder','test','test6' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '106' , field : 'service.id' } +Given path 'serviceOrder','test6' +When method get +Then status 200 +Given path 'serviceOrder','test6' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderInAddWithServiceId +Given path 'serviceOrder' +And request data[7] +When method post +Then status 201 +Given path 'serviceOrder','test','test7' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '103' , field : 'service.id' } +Given path 'serviceOrder','test7' +When method get +Then status 200 +Given path 'serviceOrder','test7' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderWithUnKnownCustomerInChange +Given path 'serviceOrder' +And request data[8] +When method post +Then status 201 +Given path 'serviceOrder','test','test8' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderMessage == '#[1]' +And match $.orderMessage[0] contains { code : '104' , field : 'relatedParty.id' } +Given path 'serviceOrder','test8' +When method get +Then status 200 +Given path 'serviceOrder','test8' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderDelete +Given path 'serviceOrder' +And request data[9] +When method post +Then status 201 +Given path 'serviceOrder','test','test9' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +Given path 'serviceOrder','test9' +When method get +Then status 200 +Given path 'serviceOrder','test9' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderDeleteRejected +Given path 'serviceOrder' +And request data[10] +When method post +Then status 201 +Given path 'serviceOrder','test','test10' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '106' , field : 'service.id' } +Given path 'serviceOrder','test10' +When method get +Then status 200 +Given path 'serviceOrder','test10' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderNoChange +Given path 'serviceOrder' +And request data[11] +When method post +Then status 201 +Given path 'serviceOrder','test','test11' +And request $ +When method put +Then status 201 +And match $.state == 'completed' +And match $.orderItem[0].state == 'completed' +And match $.orderItem[1].state == 'completed' +Given path 'serviceOrder','test11' +When method get +Then status 200 +Given path 'serviceOrder','test11' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderNoChangeAndDelete +Given path 'serviceOrder' +And request data[12] +When method post +Then status 201 +Given path 'serviceOrder','test','test12' +And request $ +When method put +Then status 201 +And match $.state == 'acknowledged' +And match $.orderItem[0].state == 'completed' +Given path 'serviceOrder','test12' +When method get +Then status 200 +Given path 'serviceOrder','test12' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderDeleteWithKoServiceSpecId +Given path 'serviceOrder' +And request data[13] +When method post +Then status 201 +Given path 'serviceOrder','test','test13' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].state == 'rejected' +Given path 'serviceOrder','test13' +When method get +Then status 200 +Given path 'serviceOrder','test13' +When method delete +Then status 204 + +Scenario: testCheckServiceOrderRejected +Given path 'serviceOrder' +And request data[14] +When method post +Then status 201 +Given path 'serviceOrder','test','test14' +And request $ +When method put +Then status 201 +And match $.state == 'rejected' +And match $.orderItem[0].orderItemMessage == '#[1]' +And match $.orderItem[0].orderItemMessage[0] contains { code : '102' , field : 'serviceSpecification.id' } +Given path 'serviceOrder','test14' +When method get +Then status 200 +Given path 'serviceOrder','test14' +When method delete +Then status 204 + + +Scenario: testFindAndGetServiceOrder +Given path 'serviceOrder' +And request data[15] +When method post +Then status 201 +Given path 'serviceOrder' +And request data[16] +When method post +Then status 201 +Given path 'serviceOrder','test','test15' +And request $ +When method put +Then status 201 +Given path 'serviceOrder','test','test16' +And request $ +When method put +Then status 201 +Given path 'serviceOrder' +And params {fields : 'id'} +When method get +Then status 200 +And match $ == '#[2]' +Given path 'serviceOrder' +And params {externalId : 'extid1' , state : 'acknowledged'} +When method get +Then status 200 +And match $ == '#[1]' +Given path 'serviceOrder','test15' +When method get +Then status 200 +And match $ contains '#notnull' +Given path 'serviceOrder','test15' +When method delete +Then status 204 +Given path 'serviceOrder','test16' +When method delete +Then status 204 + + +Scenario: testCheckServiceOrderWithCustomerAAINotResponding +* call Context.removeWireMockMapping("/aai/v11/business/customers/customer/new"); +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.id == 'test4' +And match $.state == 'rejected' +And match $.orderItem == '#[2]' +And match $.orderMessage[0] contains { code : '501' , messageInformation : 'Problem with AAI API' } +Given path 'serviceOrder','test4' +When method get +Then status 200 +* call Context.startServers(); + + +Scenario: testAAIPutServiceNotResponding +* call Context.removeWireMockMapping("/aai/v11/business/customers/customer/new/service-subscriptions/service-subscription/vFW"); +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.id == 'test4' +And match $.state == 'rejected' +Given path 'serviceOrder','test4' +When method get +Then status 200 +* call Context.startServers(); + +Scenario: testCheckServiceOrderWithSDCNotResponding +* call Context.removeWireMockMapping("/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439/metadata"); +Given path 'serviceOrder' +And request data[4] +When method post +Then status 201 +Given path 'serviceOrder','test','test4' +And request $ +When method put +Then status 201 +And match $.id == 'test4' +And match $.state == 'rejected' +And match $.orderItem[0].orderMessage[0] contains { code : '102' , field : 'serviceSpecification.id' } +Given path 'serviceOrder','test4' +When method get +Then status 200 +* call Context.startServers();
\ No newline at end of file diff --git a/src/test/resources/karatetest/features/03--Subscriber.feature b/src/test/resources/karatetest/features/03--Subscriber.feature new file mode 100644 index 0000000..851ac73 --- /dev/null +++ b/src/test/resources/karatetest/features/03--Subscriber.feature @@ -0,0 +1,66 @@ +# new feature +# Tags: optional + +Feature: Subscriber + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); +* def data = read('../data/subscriber.json') + +Scenario: testFindWhenNoSubscriber +Given path 'hub' +When method get +Then status 200 +And match $ == '#[0]' + +Scenario: testCreationAndFindSubscriber +Given path 'hub' +And request data[0] +When method post +Then status 201 +Given url 'http://localhost:8080/nbi/api/v3/hub/' +When method get +And match $ == '#[1]' + +Scenario: testGetByIdSubscriber +Given path 'hub' +When method get +And def Id = $[0].id +Given path 'hub',Id +When method get +And match $ contains { callback : 'http://localhost:8080/test' , query : 'eventType=ServiceOrderCreationNotification' } + +Scenario: testFindSubscriber +Given path 'hub' +And request data[1] +When method post +Then status 201 +Given path 'hub' +And request data[2] +When method post +Then status 201 +Given path 'hub' +When method get +Then status 200 +And match $ == '#notnull' + +Scenario: testFindWithFilteringSubscriber +Given path 'hub' +And params { query.eventType : 'ServiceOrderCreationNotification' } +When method get +Then status 200 +And match $ == '#[1]' + +Scenario: testSubscriberDeletion +Given path 'hub' +And request { id : 'id', callback : 'http://localhost:8080/test' , query : 'eventType = ServiceOrderCreationNotification' } +When method post +Then status 201 +Given path 'hub' +When method get +And def Id = $[0].id +Given path 'hub',Id +When method delete +Then status 204 diff --git a/src/test/resources/karatetest/features/04--StatusRessourceTest.feature b/src/test/resources/karatetest/features/04--StatusRessourceTest.feature new file mode 100644 index 0000000..f616e90 --- /dev/null +++ b/src/test/resources/karatetest/features/04--StatusRessourceTest.feature @@ -0,0 +1,17 @@ +# new feature +# Tags: optional + +Feature: Status Resource + +Background: +* url nbiBaseUrl +* def Context = Java.type('org.onap.nbi.test.Context'); +* call Context.startServers(); + +Scenario: testHealthCheck + +Given path 'status' +When method get +Then status 200 +And match response.status == 'ok' +And match response.name == 'nbi'
\ No newline at end of file diff --git a/src/test/resources/toscafile/service-Sdwanvpninfraservice-csar.csar b/src/test/resources/toscafile/service-Sdwanvpninfraservice-csar.csar Binary files differindex 52bdfe2..e69de29 100644 --- a/src/test/resources/toscafile/service-Sdwanvpninfraservice-csar.csar +++ b/src/test/resources/toscafile/service-Sdwanvpninfraservice-csar.csar diff --git a/src/test/resources/toscafile/service-Sotnvpninfraservice-csar.csar b/src/test/resources/toscafile/service-Sotnvpninfraservice-csar.csar Binary files differindex b4f9693..e69de29 100644 --- a/src/test/resources/toscafile/service-Sotnvpninfraservice-csar.csar +++ b/src/test/resources/toscafile/service-Sotnvpninfraservice-csar.csar diff --git a/src/test/resources/toscafile/service-TestNetwork-template.yml b/src/test/resources/toscafile/service-TestNetwork-template.yml index 0a62221..0a62221 100755..100644 --- a/src/test/resources/toscafile/service-TestNetwork-template.yml +++ b/src/test/resources/toscafile/service-TestNetwork-template.yml diff --git a/src/test/resources/toscafile/service-VfwService2vfBased-template.yml b/src/test/resources/toscafile/service-VfwService2vfBased-template.yml index b96b139..e594725 100644 --- a/src/test/resources/toscafile/service-VfwService2vfBased-template.yml +++ b/src/test/resources/toscafile/service-VfwService2vfBased-template.yml @@ -28,34 +28,34 @@ metadata: ecompGeneratedNaming: true namingPolicy: '' imports: -- nodes: - file: nodes.yml -- datatypes: - file: data.yml -- capabilities: - file: capabilities.yml -- relationships: - file: relationships.yml -- groups: - file: groups.yml -- policies: - file: policies.yml -- service-vFW-service-2VF-based-interface: - file: service-VfwService2vfBased-template-interface.yml -- resource-vFW-vSINK: - file: resource-VfwVsink-template.yml -- resource-vFW-vSINK-interface: - file: resource-VfwVsink-template-interface.yml -- resource-vPkG: - file: resource-Vpkg-template.yml -- resource-vPkG-interface: - file: resource-Vpkg-template-interface.yml + - nodes: + file: nodes.yml + - datatypes: + file: data.yml + - capabilities: + file: capabilities.yml + - relationships: + file: relationships.yml + - groups: + file: groups.yml + - policies: + file: policies.yml + - service-vFW-service-2VF-based-interface: + file: service-VfwService2vfBased-template-interface.yml + - resource-vFW-vSINK: + file: resource-VfwVsink-template.yml + - resource-vFW-vSINK-interface: + file: resource-VfwVsink-template-interface.yml + - resource-vPkG: + file: resource-Vpkg-template.yml + - resource-vPkG-interface: + file: resource-Vpkg-template-interface.yml topology_template: inputs: fortigate_image_url: type: string required: false - default: + default: flavor: type: string default: '2z' @@ -68,8 +68,8 @@ topology_template: description: Number of CPUs for the server. default: 2 entry_schema: - - constraints: - - valid_values: [ 1, 2, 4, 8 ] + - constraints: + - valid_values: [ 1, 2, 4, 8 ] node_templates: vPkG 0: type: org.openecomp.resource.vf.Vpkg @@ -1171,7 +1171,7 @@ topology_template: vf_module_label: base_vpkg max_vf_module_instances: 1 vfc_list: - vf_module_type: Base + vf_module_type: KarateBase vf_module_description: initial_count: 1 volume_group: false @@ -1189,7 +1189,7 @@ topology_template: vf_module_label: base_vfw max_vf_module_instances: 1 vfc_list: - vf_module_type: Base + vf_module_type: KarateBase vf_module_description: initial_count: 1 volume_group: false @@ -1198,693 +1198,693 @@ topology_template: node_type: org.openecomp.service.VfwService2vfBased capabilities: vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_0_port vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.incoming.bytes.rate_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.incoming.bytes.rate_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.incoming.bytes.rate_vpg_vpg_private_0_port vfwvsink0.vfw.abstract_vfw.disk.device.write.bytes.rate_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.write.bytes.rate_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.write.bytes.rate_vfw vpkg0.vpg.abstract_vpg.host_vpg: - - vpkg0 - - vpg.abstract_vpg.host_vpg + - vpkg0 + - vpg.abstract_vpg.host_vpg vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.outgoing.bytes_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.outgoing.bytes_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.outgoing.bytes_vpg_vpg_private_0_port vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.outgoing.bytes.rate_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.outgoing.bytes.rate_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.outgoing.bytes.rate_vpg_vpg_private_1_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.attachment_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.attachment_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.attachment_vfw_vfw_private_1_port vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.incoming.packets.rate_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.incoming.packets.rate_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.incoming.packets.rate_vsn_vsn_private_0_port vfwvsink0.vfw.abstract_vfw.disk.read.bytes.rate_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.read.bytes.rate_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.read.bytes.rate_vfw vfwvsink0.vfw.abstract_vfw.disk.iops_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.iops_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.iops_vfw vpkg0.vpg_vpg_private_1_port.abstract_vpg.feature_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.feature_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.feature_vpg_vpg_private_1_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_1_port vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.binding_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.binding_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.binding_vsn_vsn_private_0_port vpkg0.vpg.abstract_vpg.disk.device.read.requests.rate_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.read.requests.rate_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.read.requests.rate_vpg vfwvsink0.vsn.abstract_vsn.memory.resident_vsn: - - vfwvsink0 - - vsn.abstract_vsn.memory.resident_vsn + - vfwvsink0 + - vsn.abstract_vsn.memory.resident_vsn vpkg0.vpg.abstract_vpg.disk.write.requests.rate_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.write.requests.rate_vpg + - vpkg0 + - vpg.abstract_vpg.disk.write.requests.rate_vpg vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_1_port vfwvsink0.vsn.abstract_vsn.disk.write.bytes.rate_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.write.bytes.rate_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.write.bytes.rate_vsn vfwvsink0.vfw.abstract_vfw.instance_vfw: - - vfwvsink0 - - vfw.abstract_vfw.instance_vfw + - vfwvsink0 + - vfw.abstract_vfw.instance_vfw vfwvsink0.vfw.abstract_vfw.disk.write.requests.rate_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.write.requests.rate_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.write.requests.rate_vfw vfwvsink0.vfw.abstract_vfw.binding_vfw: - - vfwvsink0 - - vfw.abstract_vfw.binding_vfw + - vfwvsink0 + - vfw.abstract_vfw.binding_vfw vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_0_port vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.incoming.bytes_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.incoming.bytes_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.incoming.bytes_vpg_vpg_private_0_port vfwvsink0.unprotected_private_network.feature: - - vfwvsink0 - - unprotected_private_network.feature + - vfwvsink0 + - unprotected_private_network.feature vpkg0.vpg.abstract_vpg.disk.read.bytes.rate_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.read.bytes.rate_vpg + - vpkg0 + - vpg.abstract_vpg.disk.read.bytes.rate_vpg vpkg0.vpg_vpg_private_1_port.abstract_vpg.binding_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.binding_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.binding_vpg_vpg_private_1_port vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.incoming.packets_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.incoming.packets_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.incoming.packets_vsn_vsn_private_1_port vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.outgoing.packets.rate_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.outgoing.packets.rate_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.outgoing.packets.rate_vpg_vpg_private_1_port vfwvsink0.vfw.abstract_vfw.disk.device.read.requests_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.read.requests_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.read.requests_vfw vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_1_port vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.outgoing.bytes_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.outgoing.bytes_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.outgoing.bytes_vsn_vsn_private_1_port vfwvsink0.vsn.abstract_vsn.cpu_vsn: - - vfwvsink0 - - vsn.abstract_vsn.cpu_vsn + - vfwvsink0 + - vsn.abstract_vsn.cpu_vsn vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.attachment_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.attachment_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.attachment_vsn_vsn_private_1_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.binding_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.binding_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.binding_vfw_vfw_private_2_port vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.outgoing.bytes.rate_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.outgoing.bytes.rate_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.outgoing.bytes.rate_vsn_vsn_private_0_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.feature_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.feature_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.feature_vfw_vfw_private_1_port vfwvsink0.vfw.abstract_vfw.disk.usage_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.usage_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.usage_vfw vpkg0.vpg.abstract_vpg.vcpus_vpg: - - vpkg0 - - vpg.abstract_vpg.vcpus_vpg + - vpkg0 + - vpg.abstract_vpg.vcpus_vpg vfwvsink0.vfw.abstract_vfw.disk.device.allocation_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.allocation_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.allocation_vfw vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.attachment_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.attachment_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.attachment_vsn_vsn_private_0_port vfwvsink0.vsn.abstract_vsn.memory_vsn: - - vfwvsink0 - - vsn.abstract_vsn.memory_vsn + - vfwvsink0 + - vsn.abstract_vsn.memory_vsn vfwvsink0.vfw.abstract_vfw.os_vfw: - - vfwvsink0 - - vfw.abstract_vfw.os_vfw + - vfwvsink0 + - vfw.abstract_vfw.os_vfw vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.feature_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.feature_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.feature_vsn_vsn_private_0_port vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.outpoing.packets_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.outpoing.packets_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.outpoing.packets_vpg_vpg_private_1_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.binding_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.binding_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.binding_vfw_vfw_private_1_port vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.incoming.packets.rate_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.incoming.packets.rate_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.incoming.packets.rate_vsn_vsn_private_1_port vfwvsink0.vfw.abstract_vfw.disk.device.write.requests_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.write.requests_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.write.requests_vfw vpkg0.vpg.abstract_vpg.cpu_vpg: - - vpkg0 - - vpg.abstract_vpg.cpu_vpg + - vpkg0 + - vpg.abstract_vpg.cpu_vpg vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.outgoing.packets.rate_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.outgoing.packets.rate_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.outgoing.packets.rate_vsn_vsn_private_1_port vfwvsink0.vsn.abstract_vsn.disk.device.write.bytes_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.write.bytes_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.write.bytes_vsn vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.feature_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.feature_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.feature_vfw_vfw_private_2_port vfwvsink0.vsn.abstract_vsn.host_vsn: - - vfwvsink0 - - vsn.abstract_vsn.host_vsn + - vfwvsink0 + - vsn.abstract_vsn.host_vsn vpkg0.vpg_vpg_private_1_port.abstract_vpg.attachment_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.attachment_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.attachment_vpg_vpg_private_1_port vfwvsink0.vfw.abstract_vfw.disk.device.write.bytes_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.write.bytes_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.write.bytes_vfw vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_0_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_2_port vfwvsink0.vfw.abstract_vfw.memory.resident_vfw: - - vfwvsink0 - - vfw.abstract_vfw.memory.resident_vfw + - vfwvsink0 + - vfw.abstract_vfw.memory.resident_vfw vfwvsink0.vsn.abstract_vsn.vcpus_vsn: - - vfwvsink0 - - vsn.abstract_vsn.vcpus_vsn + - vfwvsink0 + - vsn.abstract_vsn.vcpus_vsn vfwvsink0.vfw.abstract_vfw.disk.read.requests_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.read.requests_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.read.requests_vfw vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.incoming.packets_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.incoming.packets_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.incoming.packets_vpg_vpg_private_1_port vfwvsink0.unprotected_private_network.link: - - vfwvsink0 - - unprotected_private_network.link + - vfwvsink0 + - unprotected_private_network.link vpkg0.vpg.abstract_vpg.disk.device.latency_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.latency_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.latency_vpg vfwvsink0.vfw.abstract_vfw.disk.write.requests_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.write.requests_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.write.requests_vfw vfwvsink0.vsn.abstract_vsn.disk.capacity_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.capacity_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.capacity_vsn vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_2_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_2_port vfwvsink0.vsn.abstract_vsn.scalable_vsn: - - vfwvsink0 - - vsn.abstract_vsn.scalable_vsn + - vfwvsink0 + - vsn.abstract_vsn.scalable_vsn vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.incoming.bytes_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.incoming.bytes_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.incoming.bytes_vsn_vsn_private_1_port vfwvsink0.vfw.abstract_vfw.disk.write.bytes_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.write.bytes_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.write.bytes_vfw vfwvsink0.vfw.abstract_vfw.disk.device.read.bytes.rate_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.read.bytes.rate_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.read.bytes.rate_vfw vpkg0.vpg.abstract_vpg.disk.write.bytes_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.write.bytes_vpg + - vpkg0 + - vpg.abstract_vpg.disk.write.bytes_vpg vpkg0.vpg.abstract_vpg.disk.device.write.bytes.rate_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.write.bytes.rate_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.write.bytes.rate_vpg vpkg0.vpg.abstract_vpg.memory.usage_vpg: - - vpkg0 - - vpg.abstract_vpg.memory.usage_vpg + - vpkg0 + - vpg.abstract_vpg.memory.usage_vpg vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.outpoing.packets_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.outpoing.packets_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.outpoing.packets_vsn_vsn_private_1_port vfwvsink0.vsn.abstract_vsn.memory.usage_vsn: - - vfwvsink0 - - vsn.abstract_vsn.memory.usage_vsn + - vfwvsink0 + - vsn.abstract_vsn.memory.usage_vsn vfwvsink0.vsn.abstract_vsn.disk.device.read.bytes.rate_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.read.bytes.rate_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.read.bytes.rate_vsn vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.incoming.bytes_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.incoming.bytes_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.incoming.bytes_vsn_vsn_private_0_port vfwvsink0.vfw.abstract_vfw.disk.ephemeral.size_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.ephemeral.size_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.ephemeral.size_vfw vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.attachment_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.attachment_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.attachment_vfw_vfw_private_0_port vfwvsink0.vsn.abstract_vsn.binding_vsn: - - vfwvsink0 - - vsn.abstract_vsn.binding_vsn + - vfwvsink0 + - vsn.abstract_vsn.binding_vsn vfwvsink0.vfw.abstract_vfw.cpu.delta_vfw: - - vfwvsink0 - - vfw.abstract_vfw.cpu.delta_vfw + - vfwvsink0 + - vfw.abstract_vfw.cpu.delta_vfw vfwvsink0.vsn.abstract_vsn.disk.read.bytes.rate_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.read.bytes.rate_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.read.bytes.rate_vsn vfwvsink0.vfw.abstract_vfw.disk.latency_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.latency_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.latency_vfw vfwvsink0.vsn.abstract_vsn.disk.device.latency_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.latency_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.latency_vsn vfwvsink0.vsn.abstract_vsn.disk.latency_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.latency_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.latency_vsn vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.outgoing.packets.rate_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.outgoing.packets.rate_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.outgoing.packets.rate_vpg_vpg_private_0_port vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.incoming.packets.rate_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.incoming.packets.rate_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.incoming.packets.rate_vpg_vpg_private_1_port vfwvsink0.vsn.abstract_vsn.instance_vsn: - - vfwvsink0 - - vsn.abstract_vsn.instance_vsn + - vfwvsink0 + - vsn.abstract_vsn.instance_vsn vfwvsink0.vsn.abstract_vsn.disk.device.allocation_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.allocation_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.allocation_vsn vpkg0.vpg.abstract_vpg.disk.allocation_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.allocation_vpg + - vpkg0 + - vpg.abstract_vpg.disk.allocation_vpg vfwvsink0.vsn.abstract_vsn.disk.read.bytes_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.read.bytes_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.read.bytes_vsn vpkg0.vpg.abstract_vpg.disk.device.write.requests_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.write.requests_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.write.requests_vpg vpkg0.vpg.abstract_vpg.disk.device.write.requests.rate_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.write.requests.rate_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.write.requests.rate_vpg vpkg0.vpg.abstract_vpg.disk.device.read.bytes_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.read.bytes_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.read.bytes_vpg vpkg0.vpg.abstract_vpg.disk.device.read.requests_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.read.requests_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.read.requests_vpg vfwvsink0.vsn.abstract_vsn.cpu_util_vsn: - - vfwvsink0 - - vsn.abstract_vsn.cpu_util_vsn + - vfwvsink0 + - vsn.abstract_vsn.cpu_util_vsn vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.incoming.packets_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.incoming.packets_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.incoming.packets_vpg_vpg_private_0_port vpkg0.vpg.abstract_vpg.disk.device.read.bytes.rate_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.read.bytes.rate_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.read.bytes.rate_vpg vfwvsink0.vfw.abstract_vfw.disk.read.bytes_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.read.bytes_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.read.bytes_vfw vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.outgoing.packets.rate_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.outgoing.packets.rate_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.outgoing.packets.rate_vsn_vsn_private_0_port vpkg0.vpg.abstract_vpg.disk.read.requests_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.read.requests_vpg + - vpkg0 + - vpg.abstract_vpg.disk.read.requests_vpg vpkg0.vpg.abstract_vpg.disk.root.size_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.root.size_vpg + - vpkg0 + - vpg.abstract_vpg.disk.root.size_vpg vfwvsink0.vfw.abstract_vfw.disk.device.write.requests.rate_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.write.requests.rate_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.write.requests.rate_vfw vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_0_port vfwvsink0.vfw.abstract_vfw.cpu_vfw: - - vfwvsink0 - - vfw.abstract_vfw.cpu_vfw + - vfwvsink0 + - vfw.abstract_vfw.cpu_vfw vpkg0.vpg.abstract_vpg.cpu_util_vpg: - - vpkg0 - - vpg.abstract_vpg.cpu_util_vpg + - vpkg0 + - vpg.abstract_vpg.cpu_util_vpg vfwvsink0.vfw.abstract_vfw.disk.write.bytes.rate_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.write.bytes.rate_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.write.bytes.rate_vfw vfwvsink0.vsn.abstract_vsn.disk.ephemeral.size_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.ephemeral.size_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.ephemeral.size_vsn vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.outgoing.bytes_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.outgoing.bytes_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.outgoing.bytes_vsn_vsn_private_0_port vfwvsink0.vsn.abstract_vsn.disk.root.size_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.root.size_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.root.size_vsn vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.binding_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.binding_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.binding_vfw_vfw_private_0_port vpkg0.vpg.abstract_vpg.scalable_vpg: - - vpkg0 - - vpg.abstract_vpg.scalable_vpg + - vpkg0 + - vpg.abstract_vpg.scalable_vpg vpkg0.vpg.abstract_vpg.disk.usage_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.usage_vpg + - vpkg0 + - vpg.abstract_vpg.disk.usage_vpg vfwvsink0.unprotected_private_network.end_point: - - vfwvsink0 - - unprotected_private_network.end_point + - vfwvsink0 + - unprotected_private_network.end_point vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.incoming.bytes.rate_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.incoming.bytes.rate_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.incoming.bytes.rate_vsn_vsn_private_1_port vfwvsink0.vfw.abstract_vfw.vcpus_vfw: - - vfwvsink0 - - vfw.abstract_vfw.vcpus_vfw + - vfwvsink0 + - vfw.abstract_vfw.vcpus_vfw vfwvsink0.vfw.abstract_vfw.disk.device.read.requests.rate_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.read.requests.rate_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.read.requests.rate_vfw vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.outpoing.packets_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.outpoing.packets_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.outpoing.packets_vsn_vsn_private_0_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.attachment_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.attachment_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.attachment_vfw_vfw_private_2_port vpkg0.vpg_vpg_private_0_port.abstract_vpg.binding_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.binding_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.binding_vpg_vpg_private_0_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_1_port vpkg0.vpg.abstract_vpg.disk.write.bytes.rate_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.write.bytes.rate_vpg + - vpkg0 + - vpg.abstract_vpg.disk.write.bytes.rate_vpg vfwvsink0.protected_private_network.feature: - - vfwvsink0 - - protected_private_network.feature + - vfwvsink0 + - protected_private_network.feature vpkg0.vpg.abstract_vpg.disk.capacity_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.capacity_vpg + - vpkg0 + - vpg.abstract_vpg.disk.capacity_vpg vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.outgoing.bytes_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.outgoing.bytes_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.outgoing.bytes_vpg_vpg_private_1_port vfwvsink0.protected_private_network.attachment: - - vfwvsink0 - - protected_private_network.attachment + - vfwvsink0 + - protected_private_network.attachment vfwvsink0.vfw.abstract_vfw.disk.device.read.bytes_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.read.bytes_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.read.bytes_vfw vfwvsink0.vfw.abstract_vfw.disk.capacity_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.capacity_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.capacity_vfw vfwvsink0.vsn.abstract_vsn.disk.write.bytes_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.write.bytes_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.write.bytes_vsn vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.feature_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.feature_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.feature_vfw_vfw_private_0_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.outgoing.bytes.rate_vfw_vfw_private_2_port vfwvsink0.vfw.abstract_vfw.memory.usage_vfw: - - vfwvsink0 - - vfw.abstract_vfw.memory.usage_vfw + - vfwvsink0 + - vfw.abstract_vfw.memory.usage_vfw vfwvsink0.vfw.abstract_vfw.disk.root.size_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.root.size_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.root.size_vfw vfwvsink0.vsn.abstract_vsn.feature_vsn: - - vfwvsink0 - - vsn.abstract_vsn.feature_vsn + - vfwvsink0 + - vsn.abstract_vsn.feature_vsn vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_2_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.incoming.bytes.rate_vfw_vfw_private_1_port vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.feature_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.feature_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.feature_vsn_vsn_private_1_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.incoming.packets_vfw_vfw_private_1_port vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.incoming.packets.rate_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.incoming.packets.rate_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.incoming.packets.rate_vpg_vpg_private_0_port vfwvsink0.vfw.abstract_vfw.disk.device.iops_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.iops_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.iops_vfw vpkg0.vpg.abstract_vpg.disk.device.iops_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.iops_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.iops_vpg vpkg0.vpg.abstract_vpg.endpoint_vpg: - - vpkg0 - - vpg.abstract_vpg.endpoint_vpg + - vpkg0 + - vpg.abstract_vpg.endpoint_vpg vfwvsink0.vsn.abstract_vsn.disk.device.write.requests_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.write.requests_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.write.requests_vsn vfwvsink0.vsn.abstract_vsn.disk.read.requests_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.read.requests_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.read.requests_vsn vfwvsink0.vsn.abstract_vsn.endpoint_vsn: - - vfwvsink0 - - vsn.abstract_vsn.endpoint_vsn + - vfwvsink0 + - vsn.abstract_vsn.endpoint_vsn vfwvsink0.vfw.abstract_vfw.cpu_util_vfw: - - vfwvsink0 - - vfw.abstract_vfw.cpu_util_vfw + - vfwvsink0 + - vfw.abstract_vfw.cpu_util_vfw vpkg0.vpg.abstract_vpg.os_vpg: - - vpkg0 - - vpg.abstract_vpg.os_vpg + - vpkg0 + - vpg.abstract_vpg.os_vpg vfwvsink0.vsn.abstract_vsn.disk.device.usage_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.usage_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.usage_vsn vfwvsink0.unprotected_private_network.attachment: - - vfwvsink0 - - unprotected_private_network.attachment + - vfwvsink0 + - unprotected_private_network.attachment vpkg0.vpg.abstract_vpg.disk.device.usage_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.usage_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.usage_vpg vfwvsink0.vfw.abstract_vfw.memory_vfw: - - vfwvsink0 - - vfw.abstract_vfw.memory_vfw + - vfwvsink0 + - vfw.abstract_vfw.memory_vfw vpkg0.vpg.abstract_vpg.disk.latency_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.latency_vpg + - vpkg0 + - vpg.abstract_vpg.disk.latency_vpg vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.outgoing.bytes_vfw_vfw_private_2_port vfwvsink0.vsn.abstract_vsn.disk.device.read.requests_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.read.requests_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.read.requests_vsn vfwvsink0.vsn.abstract_vsn.disk.write.requests.rate_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.write.requests.rate_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.write.requests.rate_vsn vfwvsink0.vsn.abstract_vsn.disk.device.capacity_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.capacity_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.capacity_vsn vpkg0.vpg.abstract_vpg.disk.ephemeral.size_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.ephemeral.size_vpg + - vpkg0 + - vpg.abstract_vpg.disk.ephemeral.size_vpg vpkg0.vpg.abstract_vpg.disk.iops_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.iops_vpg + - vpkg0 + - vpg.abstract_vpg.disk.iops_vpg vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.incoming.bytes_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.incoming.bytes_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.incoming.bytes_vpg_vpg_private_1_port vpkg0.vpg_vpg_private_1_port.abstract_vpg.network.incoming.bytes.rate_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.network.incoming.bytes.rate_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.network.incoming.bytes.rate_vpg_vpg_private_1_port vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.incoming.packets_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.incoming.packets_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.incoming.packets_vsn_vsn_private_0_port vpkg0.vpg.abstract_vpg.feature_vpg: - - vpkg0 - - vpg.abstract_vpg.feature_vpg + - vpkg0 + - vpg.abstract_vpg.feature_vpg vpkg0.vpg.abstract_vpg.instance_vpg: - - vpkg0 - - vpg.abstract_vpg.instance_vpg + - vpkg0 + - vpg.abstract_vpg.instance_vpg vfwvsink0.protected_private_network.end_point: - - vfwvsink0 - - protected_private_network.end_point + - vfwvsink0 + - protected_private_network.end_point vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.network.incoming.bytes.rate_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.network.incoming.bytes.rate_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.network.incoming.bytes.rate_vsn_vsn_private_0_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_2_port vpkg0.vpg_vpg_private_0_port.abstract_vpg.feature_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.feature_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.feature_vpg_vpg_private_0_port vfwvsink0.vfw.abstract_vfw.host_vfw: - - vfwvsink0 - - vfw.abstract_vfw.host_vfw + - vfwvsink0 + - vfw.abstract_vfw.host_vfw vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.binding_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.binding_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.binding_vsn_vsn_private_1_port vpkg0.vpg.abstract_vpg.disk.device.capacity_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.capacity_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.capacity_vpg vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.network.outgoing.bytes.rate_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.network.outgoing.bytes.rate_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.network.outgoing.bytes.rate_vsn_vsn_private_1_port vfwvsink0.vsn.abstract_vsn.disk.device.write.requests.rate_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.write.requests.rate_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.write.requests.rate_vsn vfwvsink0.vsn.abstract_vsn.disk.device.write.bytes.rate_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.write.bytes.rate_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.write.bytes.rate_vsn vpkg0.vpg.abstract_vpg.disk.write.requests_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.write.requests_vpg + - vpkg0 + - vpg.abstract_vpg.disk.write.requests_vpg vfwvsink0.vsn.abstract_vsn.disk.allocation_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.allocation_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.allocation_vsn vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_1_port vpkg0.vpg.abstract_vpg.cpu.delta_vpg: - - vpkg0 - - vpg.abstract_vpg.cpu.delta_vpg + - vpkg0 + - vpg.abstract_vpg.cpu.delta_vpg vfwvsink0.vfw.abstract_vfw.disk.device.latency_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.latency_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.latency_vfw vfwvsink0.vsn.abstract_vsn.disk.device.read.requests.rate_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.read.requests.rate_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.read.requests.rate_vsn vpkg0.vpg.abstract_vpg.memory_vpg: - - vpkg0 - - vpg.abstract_vpg.memory_vpg + - vpkg0 + - vpg.abstract_vpg.memory_vpg vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.incoming.packets.rate_vfw_vfw_private_0_port vfwvsink0.vsn.abstract_vsn.disk.device.iops_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.iops_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.iops_vsn vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.outpoing.packets_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.outpoing.packets_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.outpoing.packets_vpg_vpg_private_0_port vfwvsink0.vsn.abstract_vsn.disk.usage_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.usage_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.usage_vsn vfwvsink0.vfw.abstract_vfw.disk.device.capacity_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.capacity_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.capacity_vfw vpkg0.vpg_vpg_private_0_port.abstract_vpg.network.outgoing.bytes.rate_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.network.outgoing.bytes.rate_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.network.outgoing.bytes.rate_vpg_vpg_private_0_port vpkg0.vpg.abstract_vpg.disk.device.write.bytes_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.write.bytes_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.write.bytes_vpg vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_0_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_2_port vfwvsink0.vfw.abstract_vfw.feature_vfw: - - vfwvsink0 - - vfw.abstract_vfw.feature_vfw + - vfwvsink0 + - vfw.abstract_vfw.feature_vfw vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.outgoing.packets.rate_vfw_vfw_private_0_port vfwvsink0.vsn.abstract_vsn.os_vsn: - - vfwvsink0 - - vsn.abstract_vsn.os_vsn + - vfwvsink0 + - vsn.abstract_vsn.os_vsn vfwvsink0.vfw.abstract_vfw.disk.device.usage_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.device.usage_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.device.usage_vfw vfwvsink0.vsn.abstract_vsn.disk.iops_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.iops_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.iops_vsn vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.network.incoming.bytes_vfw_vfw_private_0_port vpkg0.vpg_vpg_private_0_port.abstract_vpg.attachment_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.attachment_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.attachment_vpg_vpg_private_0_port vpkg0.vpg.abstract_vpg.memory.resident_vpg: - - vpkg0 - - vpg.abstract_vpg.memory.resident_vpg + - vpkg0 + - vpg.abstract_vpg.memory.resident_vpg vfwvsink0.vfw.abstract_vfw.scalable_vfw: - - vfwvsink0 - - vfw.abstract_vfw.scalable_vfw + - vfwvsink0 + - vfw.abstract_vfw.scalable_vfw vfwvsink0.vsn.abstract_vsn.cpu.delta_vsn: - - vfwvsink0 - - vsn.abstract_vsn.cpu.delta_vsn + - vfwvsink0 + - vsn.abstract_vsn.cpu.delta_vsn vpkg0.vpg.abstract_vpg.disk.device.allocation_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.device.allocation_vpg + - vpkg0 + - vpg.abstract_vpg.disk.device.allocation_vpg vfwvsink0.protected_private_network.link: - - vfwvsink0 - - protected_private_network.link + - vfwvsink0 + - protected_private_network.link vfwvsink0.vfw.abstract_vfw.disk.allocation_vfw: - - vfwvsink0 - - vfw.abstract_vfw.disk.allocation_vfw + - vfwvsink0 + - vfw.abstract_vfw.disk.allocation_vfw vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.network.outpoing.packets_vfw_vfw_private_1_port vpkg0.vpg.abstract_vpg.binding_vpg: - - vpkg0 - - vpg.abstract_vpg.binding_vpg + - vpkg0 + - vpg.abstract_vpg.binding_vpg vpkg0.vpg.abstract_vpg.disk.read.bytes_vpg: - - vpkg0 - - vpg.abstract_vpg.disk.read.bytes_vpg + - vpkg0 + - vpg.abstract_vpg.disk.read.bytes_vpg vfwvsink0.vsn.abstract_vsn.disk.device.read.bytes_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.device.read.bytes_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.device.read.bytes_vsn vfwvsink0.vsn.abstract_vsn.disk.write.requests_vsn: - - vfwvsink0 - - vsn.abstract_vsn.disk.write.requests_vsn + - vfwvsink0 + - vsn.abstract_vsn.disk.write.requests_vsn vfwvsink0.vfw.abstract_vfw.endpoint_vfw: - - vfwvsink0 - - vfw.abstract_vfw.endpoint_vfw + - vfwvsink0 + - vfw.abstract_vfw.endpoint_vfw requirements: vfwvsink0.vfw.abstract_vfw.local_storage_vfw: - - vfwvsink0 - - vfw.abstract_vfw.local_storage_vfw + - vfwvsink0 + - vfw.abstract_vfw.local_storage_vfw vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.dependency_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.dependency_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.dependency_vfw_vfw_private_1_port vpkg0.vpg.abstract_vpg.local_storage_vpg: - - vpkg0 - - vpg.abstract_vpg.local_storage_vpg + - vpkg0 + - vpg.abstract_vpg.local_storage_vpg vpkg0.vpg_vpg_private_1_port.abstract_vpg.dependency_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.dependency_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.dependency_vpg_vpg_private_1_port vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.dependency_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.dependency_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.dependency_vsn_vsn_private_1_port vfwvsink0.vsn_vsn_private_1_port.abstract_vsn.link_vsn_vsn_private_1_port: - - vfwvsink0 - - vsn_vsn_private_1_port.abstract_vsn.link_vsn_vsn_private_1_port + - vfwvsink0 + - vsn_vsn_private_1_port.abstract_vsn.link_vsn_vsn_private_1_port vpkg0.vpg_vpg_private_1_port.abstract_vpg.link_vpg_vpg_private_1_port: - - vpkg0 - - vpg_vpg_private_1_port.abstract_vpg.link_vpg_vpg_private_1_port + - vpkg0 + - vpg_vpg_private_1_port.abstract_vpg.link_vpg_vpg_private_1_port vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.link_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.link_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.link_vfw_vfw_private_0_port vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.link_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.link_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.link_vsn_vsn_private_0_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.link_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.link_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.link_vfw_vfw_private_2_port vfwvsink0.vfw.abstract_vfw.dependency_vfw: - - vfwvsink0 - - vfw.abstract_vfw.dependency_vfw + - vfwvsink0 + - vfw.abstract_vfw.dependency_vfw vfwvsink0.vsn.abstract_vsn.local_storage_vsn: - - vfwvsink0 - - vsn.abstract_vsn.local_storage_vsn + - vfwvsink0 + - vsn.abstract_vsn.local_storage_vsn vfwvsink0.unprotected_private_network.dependency: - - vfwvsink0 - - unprotected_private_network.dependency + - vfwvsink0 + - unprotected_private_network.dependency vfwvsink0.vfw_vfw_private_0_port.abstract_vfw.dependency_vfw_vfw_private_0_port: - - vfwvsink0 - - vfw_vfw_private_0_port.abstract_vfw.dependency_vfw_vfw_private_0_port + - vfwvsink0 + - vfw_vfw_private_0_port.abstract_vfw.dependency_vfw_vfw_private_0_port vfwvsink0.vsn.abstract_vsn.dependency_vsn: - - vfwvsink0 - - vsn.abstract_vsn.dependency_vsn + - vfwvsink0 + - vsn.abstract_vsn.dependency_vsn vpkg0.vpg_vpg_private_0_port.abstract_vpg.dependency_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.dependency_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.dependency_vpg_vpg_private_0_port vfwvsink0.vsn_vsn_private_0_port.abstract_vsn.dependency_vsn_vsn_private_0_port: - - vfwvsink0 - - vsn_vsn_private_0_port.abstract_vsn.dependency_vsn_vsn_private_0_port + - vfwvsink0 + - vsn_vsn_private_0_port.abstract_vsn.dependency_vsn_vsn_private_0_port vfwvsink0.vfw_vfw_private_2_port.abstract_vfw.dependency_vfw_vfw_private_2_port: - - vfwvsink0 - - vfw_vfw_private_2_port.abstract_vfw.dependency_vfw_vfw_private_2_port + - vfwvsink0 + - vfw_vfw_private_2_port.abstract_vfw.dependency_vfw_vfw_private_2_port vfwvsink0.vfw_vfw_private_1_port.abstract_vfw.link_vfw_vfw_private_1_port: - - vfwvsink0 - - vfw_vfw_private_1_port.abstract_vfw.link_vfw_vfw_private_1_port + - vfwvsink0 + - vfw_vfw_private_1_port.abstract_vfw.link_vfw_vfw_private_1_port vpkg0.vpg_vpg_private_0_port.abstract_vpg.link_vpg_vpg_private_0_port: - - vpkg0 - - vpg_vpg_private_0_port.abstract_vpg.link_vpg_vpg_private_0_port + - vpkg0 + - vpg_vpg_private_0_port.abstract_vpg.link_vpg_vpg_private_0_port vpkg0.vpg.abstract_vpg.dependency_vpg: - - vpkg0 - - vpg.abstract_vpg.dependency_vpg + - vpkg0 + - vpg.abstract_vpg.dependency_vpg vfwvsink0.protected_private_network.dependency: - - vfwvsink0 - - protected_private_network.dependency + - vfwvsink0 + - protected_private_network.dependency |