From ce4838cf3836facbe397b25440922320b421141a Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Mon, 5 Aug 2019 10:56:25 +0300 Subject: change management return 400 handling NPE return 400 internal status when exception is thrown during extracting serviceInstanceId Issue-ID: VID-378 Signed-off-by: Eylon Malin Change-Id: I97f740de0a700f503d115033980f8e8366e806e7 --- .../test/java/org/onap/vid/api/ChangeManagementApiTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'vid-automation/src/test/java/org/onap') diff --git a/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java index 999b66cee..7490c0610 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java @@ -64,11 +64,10 @@ public class ChangeManagementApiTest extends BaseApiTest { @DataProvider public static Object[][] requestWithoutServiceInstanceId(Method test) { return new Object[][]{ - {(Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(null)}, - {(Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(new ArrayList<>())}, - {(Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).getRelatedInstList().get(0).setRelatedInstance(null)}, - {(Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).getRelatedInstList().get(0).getRelatedInstance().setInstanceId(null)} - + {"RelatedInstList null", (Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(null)}, + {"Empty list", (Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(new ArrayList<>())}, + {"Related instance null", (Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).getRelatedInstList().get(0).setRelatedInstance(null)}, + {"instanceId null", (Consumer) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).getRelatedInstList().get(0).getRelatedInstance().setInstanceId(null)} }; } @@ -178,7 +177,7 @@ public class ChangeManagementApiTest extends BaseApiTest { } @Test(dataProvider = "requestWithoutServiceInstanceId") - public void testInPlaceSoftwareUpdateWithoutServiceInstanceId(Consumer dropInstanceIdMethod) throws IOException { + public void testInPlaceSoftwareUpdateWithoutServiceInstanceId(String desc, Consumer dropInstanceIdMethod) throws IOException { testChangeManagementServiceInstanceId(dropInstanceIdMethod, ChangeManagementRequest.VNF_IN_PLACE_SOFTWARE_UPDATE); } @@ -289,7 +288,7 @@ public class ChangeManagementApiTest extends BaseApiTest { } @Test(dataProvider = "requestWithoutServiceInstanceId") - public void testConfigUpdateWithoutServiceInstanceId(Consumer dropInstanceIdMethod) throws IOException { + public void testConfigUpdateWithoutServiceInstanceId(String desc, Consumer dropInstanceIdMethod) throws IOException { testChangeManagementServiceInstanceId(dropInstanceIdMethod, ChangeManagementRequest.CONFIG_UPDATE); } -- cgit 1.2.3-korg