aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-08-05 10:56:25 +0300
committerEylon Malin <eylon.malin@intl.att.com>2019-08-05 10:56:25 +0300
commitce4838cf3836facbe397b25440922320b421141a (patch)
tree4f359fb17e03dee9d786e6ed068dd4987be6c98f /vid-automation
parentc459c7efeafd556333c46c65fc4fe2616d3ef532 (diff)
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 <eylon.malin@intl.att.com> Change-Id: I97f740de0a700f503d115033980f8e8366e806e7
Diffstat (limited to 'vid-automation')
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java13
1 files changed, 6 insertions, 7 deletions
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 -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(null)},
- {(Consumer<ChangeManagementRequest>) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(new ArrayList<>())},
- {(Consumer<ChangeManagementRequest>) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).getRelatedInstList().get(0).setRelatedInstance(null)},
- {(Consumer<ChangeManagementRequest>) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).getRelatedInstList().get(0).getRelatedInstance().setInstanceId(null)}
-
+ {"RelatedInstList null", (Consumer<ChangeManagementRequest>) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(null)},
+ {"Empty list", (Consumer<ChangeManagementRequest>) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).setRelatedInstList(new ArrayList<>())},
+ {"Related instance null", (Consumer<ChangeManagementRequest>) changeManagementRequest -> changeManagementRequest.getRequestDetails().get(0).getRelatedInstList().get(0).setRelatedInstance(null)},
+ {"instanceId null", (Consumer<ChangeManagementRequest>) 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<ChangeManagementRequest> dropInstanceIdMethod) throws IOException {
+ public void testInPlaceSoftwareUpdateWithoutServiceInstanceId(String desc, Consumer<ChangeManagementRequest> 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<ChangeManagementRequest> dropInstanceIdMethod) throws IOException {
+ public void testConfigUpdateWithoutServiceInstanceId(String desc, Consumer<ChangeManagementRequest> dropInstanceIdMethod) throws IOException {
testChangeManagementServiceInstanceId(dropInstanceIdMethod, ChangeManagementRequest.CONFIG_UPDATE);
}