summaryrefslogtreecommitdiffstats
path: root/appc-inbound/appc-interfaces-service/bundle/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'appc-inbound/appc-interfaces-service/bundle/src/test/java')
-rw-r--r--appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImplTest.java20
-rw-r--r--appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java34
2 files changed, 20 insertions, 34 deletions
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));
}
@@ -145,6 +146,25 @@ public class ServiceExecutorImplTest {
}
@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());
String requestData = "{\"vnf-id\":\"\",\"current-request\" :{\"action\" : \"Audit\",\"action-identifiers\" : {\"service-instance-id\" :"
diff --git a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java b/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java
deleted file mode 100644
index 64d150a52..000000000
--- a/appc-inbound/appc-interfaces-service/bundle/src/test/java/org/onap/appc/interfaces/service/utils/ServiceConstantsTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : APPC
-* ================================================================================
-* Copyright 2018 TechMahindra
-* ================================================================================
-* Modifications Copyright (C) 2019 Ericsson
-*=================================================================================
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-* ============LICENSE_END=========================================================
-*/
-package org.onap.appc.interfaces.service.utils;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-public class ServiceConstantsTest {
-
- @Test
- public void testServiceConstants() {
- Assert.assertEquals("action-identifiers", ServiceConstants.ACTIONIDENTIFIER);
- }
-
-}