X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=appc-inbound%2Fappc-interfaces-service%2Fbundle%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fappc%2Finterfaces%2Fservice%2FexecutorImpl%2FServiceExecutorImplTest.java;h=040723f3b7cec5c5ef2ecdf9364ff06137f09f35;hb=0360dfcc5b4de89005f2724b8fbd4dcdb23979ae;hp=6cdca796b6565798780b37d6f823603a25470466;hpb=2cf3a78839c51b9de01c70f1b561b1bd059d0f69;p=appc.git diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java index 6cdca796b..040723f3b 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java @@ -123,6 +123,7 @@ public class ServiceExecutorImplTest { Mockito.doReturn(aaiServiceMock).when(executor).getAaiService(Mockito.any(AAIClient.class)); SvcLogicContext ctx = new SvcLogicContext(); ctx.setAttribute("vm-count", "1"); + ctx.setAttribute("vm[0].vnfc-name", "vnfc-name1"); Mockito.doReturn(ctx).when(executor).getSvcLogicContext(); assertEquals("\"requestOverlap\" : false", executor.isRequestOverLap(requestData)); } @@ -144,6 +145,25 @@ public class ServiceExecutorImplTest { assertEquals("\"requestOverlap\" : false", executor.isRequestOverLap(requestData)); } + @Test + public void testScopeOverlapWithVnfcNameAndInProgressRequestAndContextVariables() throws Exception { + executor = Mockito.spy(new ServiceExecutorImpl()); + String requestData = "{\"vnf-id\":\"\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id\",\"vnfc-name\" : \"vnfc-name\"}},\"in-progress-requests\" :" + + " [{\"target-id\": \"vnf-id1\",\"action\" : \"HealthCheck\",\"action-identifiers\" : {\"service-instance-id\" :" + + " \"service-instance-id1\",\"vnfc-name\" : \"vnfc-name1\",\"vserver-id\": \"vserver-id1\"}},{\"action\" :" + + " \"CheckLock\",\"action-identifiers\" : {\"service-instance-id\" : \"service-instance-id2\",\"vnfc-name\" :" + + " \"vnfc-name2\",\"vserver-id\": \"vserver-id2\"}}]}"; + AaiService aaiServiceMock = Mockito.mock(AaiService.class); + Mockito.doReturn(aaiServiceMock).when(executor).getAaiService(Mockito.any(AAIClient.class)); + SvcLogicContext ctx = new SvcLogicContext(); + ctx.setAttribute("vm-count", "1"); + ctx.setAttribute("vm[0].vnfc-name", "vnfc-name"); + ctx.setAttribute("vm[0].vserverid", "vnfc-name"); + Mockito.doReturn(ctx).when(executor).getSvcLogicContext(); + assertEquals("\"requestOverlap\" : false", executor.isRequestOverLap(requestData)); + } + @Test public void testScopeOverlapExceptionFlow() throws Exception { executor = Mockito.spy(new ServiceExecutorImpl());