diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2024-08-27 16:08:31 +0100 |
---|---|---|
committer | Priyank Maheshwari <priyank.maheshwari@est.tech> | 2024-08-30 11:17:14 +0000 |
commit | 45308e0a3309c48511a9e2d44798fddabdb16096 (patch) | |
tree | c8c604400ef09cd554f32d6a0373661775af15fc /cps-ncmp-service/src/test | |
parent | 33f81a67c8463f800203817aae328a96c0a94e8a (diff) |
Support alternate id interface for CPS-E-05 - publicProperties
- added alternate id support for the existing endpoint
- Incorporated previous comments on the indendation
- Added new component cmHandleReferenceInPath in openapi docs to depict
the correct example
Issue-ID: CPS-2378
Change-Id: I63e752fbb6cb0bde49d1ced53f063743d904d74e
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/test')
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy index b243a74cd9..9d51fff05a 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy @@ -134,17 +134,25 @@ class NetworkCmProxyInventoryFacadeSpec extends Specification { assert result.currentTrustLevel == TrustLevel.COMPLETE } - def 'Get cm handle public properties'() { + def 'Get cm handle public properties using #scenario'() { given: 'a yang modelled cm handle' def dmiProperties = [new YangModelCmHandle.Property('prop', 'some DMI property')] def publicProperties = [new YangModelCmHandle.Property('public prop', 'some public prop')] - def yangModelCmHandle = new YangModelCmHandle(id:'some-cm-handle', dmiServiceName: 'some service name', dmiProperties: dmiProperties, publicProperties: publicProperties) + def cmHandleId = 'some-cm-handle' + def alternateId = 'some-alternate-id' + def yangModelCmHandle = new YangModelCmHandle(id:cmHandleId, alternateId: alternateId, dmiServiceName: 'some service name', dmiProperties: dmiProperties, publicProperties: publicProperties) + and: 'we have corresponding cm handle for the cm handle reference' + 1 * mockAlternateIdMatcher.getCmHandleId(cmHandleRef) >> cmHandleId and: 'the system returns this yang modelled cm handle' - 1 * mockInventoryPersistence.getYangModelCmHandle('some-cm-handle') >> yangModelCmHandle - when: 'getting cm handle public properties for a given cm handle id from ncmp service' - def result = objectUnderTest.getCmHandlePublicProperties('some-cm-handle') + 1 * mockInventoryPersistence.getYangModelCmHandle(cmHandleId) >> yangModelCmHandle + when: 'getting cm handle public properties for a given cm handle reference from ncmp service' + def result = objectUnderTest.getCmHandlePublicProperties(cmHandleRef) then: 'the result returns the correct data' assert result == [ 'public prop' : 'some public prop' ] + where: 'following cm handle reference is used' + scenario | cmHandleRef + 'Cm Handle Reference as cm handle-id' | 'some-cm-handle' + 'Cm Handle Reference as alternate-id' | 'some-alternate-id' } def 'Get cm handle composite state using #scenario'() { |