From a39f8b79fdf35370c8ee83c4ee92549feaf63d3e Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 26 Feb 2019 09:54:15 -0500 Subject: 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) --- .../validation/RequestParametersValidationTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java') 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 @@ -54,6 +54,21 @@ public class RequestParametersValidationTest extends BaseTest{ assertFalse(info.getReqParameters().getUsePreload()); } + @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(), 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"))); -- cgit 1.2.3-korg