summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Moliavko <o.moliavko@samsung.com>2019-08-08 13:13:29 +0300
committerOleksandr Moliavko <o.moliavko@samsung.com>2019-08-08 13:13:29 +0300
commit6dfa17533498596be0a0f8a23f81caf531544b04 (patch)
tree49c03f7ab50dcca23efead3289ee8cbfb43e23a4
parent3b7a7443e320d6dcf9a034b0ca290598316d8821 (diff)
Added null checks for getUpdateResInputObj() return value
to prevent crash at toString() calls Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com> Change-Id: If55fd3b00fe9d2406fe1b2eeda66fa005ce13bc4
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
index fc0f51b032..91cfa93a34 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java
@@ -63,8 +63,9 @@ public class CreateAndActivatePnfResourceTest extends BaseIntegrationTest {
public void shouldWaitForMessageFromDmaapAndUpdateAaiEntryWhenAaiEntryExists() {
// given
variables.put(PNF_CORRELATION_ID, PnfManagementTestImpl.ID_WITH_ENTRY);
- if (getUpdateResInputObj("OLT") != null) {
- variables.put("resourceInput", getUpdateResInputObj("OLT").toString());
+ ResourceInput ri = getUpdateResInputObj("OLT");
+ if (ri != null) {
+ variables.put("resourceInput", ri.toString());
} else {
variables.put("resourceInput", null);
}
@@ -86,7 +87,12 @@ public class CreateAndActivatePnfResourceTest extends BaseIntegrationTest {
public void shouldCreateAaiEntryWaitForMessageFromDmaapAndUpdateAaiEntryWhenNoAaiEntryExists() {
// given
variables.put(PNF_CORRELATION_ID, PnfManagementTestImpl.ID_WITHOUT_ENTRY);
- variables.put("resourceInput", getUpdateResInputObj("OLT").toString());
+ ResourceInput ri = getUpdateResInputObj("OLT");
+ if (ri != null) {
+ variables.put("resourceInput", ri.toString());
+ } else {
+ variables.put("resourceInput", null);
+ }
// when
ProcessInstance instance =
runtimeService.startProcessInstanceByKey("CreateAndActivatePnfResource", "businessKey", variables);