diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-08-08 11:35:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-08-08 11:35:43 +0000 |
commit | de382656ba61ec63318823e24b455286e6d0e943 (patch) | |
tree | 49e24c0d8be4766bcf533ed47b7efab16b0837b2 | |
parent | 5ececa1257c70420d398a903db267e14b14b3a6a (diff) | |
parent | 6dfa17533498596be0a0f8a23f81caf531544b04 (diff) |
Merge "Added null checks for getUpdateResInputObj() return value to prevent crash at toString() calls"
-rw-r--r-- | bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAndActivatePnfResourceTest.java | 12 |
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); |