summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/test/java
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-26 09:54:15 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-26 09:56:36 -0500
commita39f8b79fdf35370c8ee83c4ee92549feaf63d3e (patch)
tree3c1a5f6f50578ec3e2111a817eb5cb9901e74258 /mso-api-handlers/mso-api-handler-infra/src/test/java
parent2fa42bd9e13394f0acd665c54d2bd8b2ec7a8265 (diff)
check that a la carte is not null
Handle the case of absent aLaCarte and usePreload settings Change-Id: Ic3413515218013870ddce97ec225edaa6b6e99c3 Issue-ID: SO-1571 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
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/validation/RequestParametersValidationTest.java15
1 files changed, 15 insertions, 0 deletions
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 3fc5a16d9d..2813ef7b70 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
@@ -55,6 +55,21 @@ public class RequestParametersValidationTest extends BaseTest{
}
@Test
+ public void testVfModuleWithNoALaCarte() throws IOException, ValidationException {
+ String requestJson = new String(Files.readAllBytes(Paths.get("src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersNoALaCarte.json")));
+ ObjectMapper mapper = new ObjectMapper();
+ ServiceInstancesRequest sir = mapper.readValue(requestJson, ServiceInstancesRequest.class);
+ ValidationInformation info = new ValidationInformation(sir, new HashMap<String, String>(), Action.createInstance,
+ 6, false, sir.getRequestDetails().getRequestParameters());
+ info.setRequestScope("vfModule");
+ sir.setServiceInstanceId("0fd90c0c-0e3a-46e2-abb5-4c4820d5985b");
+ RequestParametersValidation validation = new RequestParametersValidation();
+ validation.validate(info);
+
+ assertFalse(info.getReqParameters().getUsePreload());
+ }
+
+ @Test
public void testVfModuleWithTrueALaCarte() throws IOException, ValidationException {
String requestJson = new String(Files.readAllBytes(Paths.get("src/test/resources/MsoRequestTest/RequestParameters/VfModuleRequestParametersIsALaCarte.json")));
ObjectMapper mapper = new ObjectMapper();