aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElena Kuleshov <evn@att.com>2019-09-05 23:31:35 -0400
committerElena Kuleshov <evn@att.com>2019-09-05 23:33:46 -0400
commitb9fcebecb058baa2bb740308c8153d64d92695d2 (patch)
treee6c8eeec357bada31e74218680b8524f9c0c734e
parent27b5bdaeac9d4606348437db862fe8295b977920 (diff)
Set AAIClient on AAIValidatorImpl
AAIValidatorImpl requires setting an initialized AAIClient before validation calls Issue-ID: SO-2286 Signed-off-by: Kuleshov, Elena <evn@att.com> Change-Id: I254e8e01812e47af2855e1c1afaa5904ed792d22
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java2
2 files changed, 5 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
index 63bde79b3f..7ad74a6d86 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java
@@ -33,6 +33,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.AAIRestClientImpl;
import org.onap.so.client.aai.AAIValidatorImpl;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
@@ -151,6 +152,8 @@ public class AAIVnfResources {
.get(org.onap.aai.domain.yang.GenericVnf.class,
AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId))
.orElse(new org.onap.aai.domain.yang.GenericVnf());
+ AAIRestClientImpl client = new AAIRestClientImpl();
+ aaiValidatorImpl.setClient(client);
return aaiValidatorImpl.isPhysicalServerLocked(vnf.getVnfId());
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
index 3680eaac81..425b595686 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIVnfResourcesTest.java
@@ -53,6 +53,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.AAIRestClientImpl;
import org.onap.so.client.aai.AAIValidatorImpl;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
@@ -234,6 +235,7 @@ public class AAIVnfResourcesTest extends TestDataSetup {
boolean isVnfPserversLockedFlag = aaiVnfResources.checkVnfPserversLockedFlag("vnfId");
verify(MOCK_aaiResourcesClient, times(1)).get(eq(org.onap.aai.domain.yang.GenericVnf.class),
isA(AAIResourceUri.class));
+ verify(MOCK_aaiValidatorImpl, times(1)).setClient(isA(AAIRestClientImpl.class));
verify(MOCK_aaiValidatorImpl, times(1)).isPhysicalServerLocked(isA(String.class));
assertTrue(isVnfPserversLockedFlag);
}