aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2017-09-19 08:54:53 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-19 08:54:53 +0000
commitbe8679eda099ff56571b9c8afcc12fcb52fea48b (patch)
treeb1e1cc5519b12b7be12bc1d66e57c0c12f599986
parentd3514e9bece56c5d023628c135d64110f0e120b4 (diff)
parent0993c4cc230d8493a2aa0b1a4debee5ede35184f (diff)
Merge "Add UT for instantiate NS API"
-rw-r--r--adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java8
-rw-r--r--adapters/mso-vfc-adapter/src/test/resources/json/instantiateNsReq.json2
2 files changed, 8 insertions, 2 deletions
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
index 4c316f3196..1777dea0dc 100644
--- a/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
+++ b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
@@ -95,8 +95,10 @@ public class VfcAdapterTest {
*/
@Mock
public RestfulResponse send(String url, String methodType, String content) {
- if(url.contains(CommonConstant.NFVO_CREATE_URL) && methodType.equals(CommonConstant.MethodType.POST)) {
+ if(url.equals(CommonConstant.NFVO_CREATE_URL) && methodType.equals(CommonConstant.MethodType.POST)) {
return getResponse("createNsRsp.json");
+ } else if(url.contains("instantiate") && methodType.equals(CommonConstant.MethodType.POST)) {
+ return getResponse("instantiateNsRsp.json");
} else {
return null;
}
@@ -180,7 +182,9 @@ public class VfcAdapterTest {
@Test
public void instantiateTest() {
-
+ // get request
+ mockRestfulUtil(FILE_PATH + "instantiateNsReq.json");
+ vfcAdapter.instantiateNfvoNs(null, "9b9f02c0-298b-458a-bc9c-be3692e4f354");
}
@Test
diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/instantiateNsReq.json b/adapters/mso-vfc-adapter/src/test/resources/json/instantiateNsReq.json
index da50897b7c..9534e5ece5 100644
--- a/adapters/mso-vfc-adapter/src/test/resources/json/instantiateNsReq.json
+++ b/adapters/mso-vfc-adapter/src/test/resources/json/instantiateNsReq.json
@@ -2,6 +2,8 @@
"nsServiceName":"vIMS",
"nsServiceDescription":"vIMS NS",
"nsOperationKey":{
+ "globalSubscriberId":"9b9f02c0-298b-458a-bc9c-be3692e4f350",
+ "serviceType":"service",
"serviceId":"9b9f02c0-298b-458a-bc9c-be3692e4f351",
"operationId":"9b9f02c0-298b-458a-bc9c-be3692e4f352",
"nodeTemplateUUID":"9b9f02c0-298b-458a-bc9c-be3692e4f353"