aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/test/java
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-03-14 12:57:41 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-14 12:57:41 +0000
commitad73b9e2686d5eabe6e2289fd3cc7fefcad9558e (patch)
treecfb472d2b8069a16784869353a5904bcf19140e4 /mso-api-handlers/mso-api-handler-infra/src/test/java
parent6bcd113098d1211dbe578335719c6bb95be31310 (diff)
parentda10fa6c82bafad3f2b01f4a52fbdc5f7b5d2e04 (diff)
Merge "Pass the revised value of usePreload to JSON"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java18
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java16
2 files changed, 27 insertions, 7 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
index 23974ef1fa..d6c794ef2e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
@@ -194,6 +194,24 @@ public class ServiceInstancesTest extends BaseTest{
assertEquals("10",modelInfo.getModelUuid());
}
+
+
+ @Test
+ public void test_mapJSONtoMSOStyleUsePreload() throws IOException{
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(Include.NON_NULL);
+ String testRequest= inputStream("/ServiceInstanceDefault.json");
+ ServiceInstancesRequest sir = new ServiceInstancesRequest();
+ RequestDetails rd = new RequestDetails();
+ RequestParameters rp = new RequestParameters();
+ rp.setUsePreload(true);
+ rd.setRequestParameters(rp);
+ sir.setRequestDetails(rd);
+ String resultString = servInstances.mapJSONtoMSOStyle(testRequest, sir, false, null);
+ ServiceInstancesRequest sir1 = mapper.readValue(resultString, ServiceInstancesRequest.class);
+ assertTrue(sir1.getRequestDetails().getRequestParameters().getUsePreload());
+ }
+
@Test
public void createServiceInstanceVIDDefault() throws IOException{
TestAppender.events.clear();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java
index 8d456e3f68..bd9b95dc12 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RequestParametersValidationTest.java
@@ -50,7 +50,7 @@ public class RequestParametersValidationTest extends BaseTest{
sir.setServiceInstanceId("0fd90c0c-0e3a-46e2-abb5-4c4820d5985b");
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
-
+ assertFalse(sir.getRequestDetails().getRequestParameters().getUsePreload());
assertFalse(info.getReqParameters().getUsePreload());
}
@@ -66,7 +66,8 @@ public class RequestParametersValidationTest extends BaseTest{
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
- assertTrue(info.getReqParameters().getUsePreload());
+ assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
+ assertTrue(info.getReqParameters().getUsePreload());
}
@Test
@@ -82,6 +83,7 @@ public class RequestParametersValidationTest extends BaseTest{
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
+ assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
assertTrue(info.getReqParameters().getUsePreload());
}
@@ -97,7 +99,7 @@ public class RequestParametersValidationTest extends BaseTest{
sir.setServiceInstanceId("0fd90c0c-0e3a-46e2-abb5-4c4820d5985b");
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
-
+ assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
assertTrue(info.getReqParameters().getUsePreload());
}
@@ -113,7 +115,7 @@ public class RequestParametersValidationTest extends BaseTest{
info.setRequestScope("service");
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
-
+ assertFalse(sir.getRequestDetails().getRequestParameters().getUsePreload());
assertFalse(info.getReqParameters().getUsePreload());
}
@@ -129,7 +131,7 @@ public class RequestParametersValidationTest extends BaseTest{
info.setRequestScope("service");
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
-
+ assertFalse(sir.getRequestDetails().getRequestParameters().getUsePreload());
assertFalse(info.getReqParameters().getUsePreload());
}
@@ -145,7 +147,7 @@ public class RequestParametersValidationTest extends BaseTest{
info.setRequestScope("service");
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
-
+ assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
assertTrue(info.getReqParameters().getUsePreload());
}
@@ -161,7 +163,7 @@ public class RequestParametersValidationTest extends BaseTest{
info.setRequestScope("service");
RequestParametersValidation validation = new RequestParametersValidation();
validation.validate(info);
-
+ assertTrue(sir.getRequestDetails().getRequestParameters().getUsePreload());
assertTrue(info.getReqParameters().getUsePreload());
}
}