diff options
author | ToineSiebelink <toine.siebelink@est.tech> | 2024-03-19 10:42:07 +0000 |
---|---|---|
committer | ToineSiebelink <toine.siebelink@est.tech> | 2024-03-19 14:20:24 +0000 |
commit | 59a34f5f9e1aaea13df8903ac30ee8cb5735f205 (patch) | |
tree | 9c721c49b79b75cdfb2b309bf8cc0a28d23f584b /cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy | |
parent | bf75ff4d43dc9eb459deaf61920de22cf5c6f1ea (diff) |
Fix SonarQube warnings
targetted:
- Introduced CmResourceAddress (name agreed with Daniel and Priyank)
- Extracted out private method in AltenateIdChecker to reduce complexity
side effects:
- use 'record' java feature as suggested by ItelliJ
- had to uprade spotbugs version to avoid incorrect warning on 'record' equeals method
- convention: added missing 'asserts' in affected testware
- my preference: removed a lot of unnecessary linebreaks in affected testware
- removed redunfant (variation) of a 'delegation' test
Issue-ID: CPS-475
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: Ie0c9d5ebc33196ae14ed6c226843095a2a040d1d
Diffstat (limited to 'cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy')
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy index e154588a10..eb6c7a0f48 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/operations/DmiDataOperationsSpec.groovy @@ -28,6 +28,7 @@ import org.onap.cps.ncmp.api.impl.exception.HttpClientRequestException import org.onap.cps.ncmp.api.impl.utils.DmiServiceUrlBuilder import org.onap.cps.ncmp.api.impl.utils.context.CpsApplicationContext import org.onap.cps.ncmp.api.models.DataOperationRequest +import org.onap.cps.ncmp.api.models.CmResourceAddress import org.onap.cps.ncmp.events.async1_0_0.DataOperationEvent import org.onap.cps.ncmp.utils.TestUtils import org.onap.cps.utils.JsonObjectMapper @@ -81,8 +82,8 @@ class DmiDataOperationsSpec extends DmiOperationsBaseSpec { mockDmiRestClient.postOperationWithJsonData(expectedUrl, expectedJson, READ, NO_AUTH_HEADER) >> responseFromDmi dmiServiceUrlBuilder.getDmiDatastoreUrl(_, _) >> expectedUrl when: 'get resource data is invoked' - def result = objectUnderTest.getResourceDataFromDmi(dataStore.datastoreName, cmHandleId, resourceIdentifier, - options, NO_TOPIC, NO_REQUEST_ID, NO_AUTH_HEADER) + def cmResourceAddress = new CmResourceAddress(dataStore.datastoreName, cmHandleId, resourceIdentifier) + def result = objectUnderTest.getResourceDataFromDmi(cmResourceAddress, options, NO_TOPIC, NO_REQUEST_ID, NO_AUTH_HEADER) then: 'the result is the response from the DMI service' assert result == responseFromDmi where: 'the following parameters are used' |