summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-12-02 09:22:42 +0200
committerIttay Stern <ittay.stern@att.com>2019-12-02 09:30:41 +0200
commita2a7baa022b98919f4c008e29ba8a12b879e746c (patch)
tree30b2673fefaeae22a6f837098c43d527f46163fc /vid-app-common/src/test
parente8887222c45e7d1849cb8098997c8fb7c149ebd7 (diff)
API to get template-topology by job id
..../vid/asyncInstantiation/templateTopology/{jobId} Issue-ID: VID-724 Change-Id: I5704951a595293d10ed6ae09c0113e1cac5b5788 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/test')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
index 54015d4b3..56aaf1e83 100644
--- a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
@@ -35,15 +35,16 @@ import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.Matchers.sameInstance;
import static org.hamcrest.core.Every.everyItem;
import static org.hamcrest.core.IsEqual.equalTo;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.spy;
@@ -199,6 +200,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
Mockito.reset(aaiClient);
Mockito.reset(jobAdapterMock);
Mockito.reset(jobsBrokerServiceMock);
+ Mockito.reset(asyncInstantiationRepository);
mockAaiClientAnyNameFree();
enableAddCloudOwnerOnMsoRequest();
}
@@ -1366,4 +1368,16 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat(path, equalTo("/serviceInstantiation/v7/serviceInstances/myService/vnfs/myVNF/vfModules/myVFModule/replace"));
}
+
+ @Test
+ public void getJobRequestAsTemplate_whenIsCalled_asyncInstantiationRepositoryGetJobRequestIsDelegated() {
+ UUID jobId = UUID.randomUUID();
+ ServiceInstantiation expected = mock(ServiceInstantiation.class);
+ doReturn(expected).when(asyncInstantiationRepository).getJobRequest(jobId);
+
+ ServiceInstantiation jobRequestAsTemplate = asyncInstantiationBL.getJobRequestAsTemplate(jobId);
+
+ assertThat(jobRequestAsTemplate, is(sameInstance(expected)));
+
+ }
}