Refactor to remove false positives from Sonar 52/106952/2
authorChris André <chris.andre@yoppworks.com>
Thu, 30 Apr 2020 19:41:41 +0000 (15:41 -0400)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Sun, 10 May 2020 07:02:13 +0000 (07:02 +0000)
commita7bd374357e0737e419d196a16ff09a644417f97
treed7c85a53671c3278b0c383726add2d17c0f23dfb
parent2048043bb4c66efa28063fc1e591c0297850a6e6
Refactor to remove false positives from Sonar

- change `updateResourceInstancesNames` to account for case where `preparedResource` is null
- change `findInputByName` to return an Either<InputDefinition, RuntimeException> in order to make exceptions explicit
- create `rollbackWithEither` (+ tests) to make exceptions more explicit

Issue-ID: SDC-2992
Signed-off-by: Chris Andre <chris.andre@yoppworks.com>
Change-Id: I487994a3f9e88b0a2b14d2679c3587d85d8aa12d
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java