diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2024-09-03 17:00:17 +0100 |
---|---|---|
committer | mpriyank <priyank.maheshwari@est.tech> | 2024-09-03 17:00:26 +0100 |
commit | 1721e3c9b5f131a18478e4aa56afce3f0637d1b6 (patch) | |
tree | d76486f57af786250d64720e471db7f8a25e8874 /cps-ncmp-rest/src/test | |
parent | 582da21cb7c66b5b5f877dde4fac3de58d3cb1cb (diff) |
Support alternate id for CPS-E05 GetCmHandleDetailsById
- added support for alternate id when retreiving cmhandle details by id
- Note : The performance for alternate id fetching will be taken care as
part of a separate story.
Issue-ID: CPS-2385
Change-Id: I019b85d128e4b0a1f1d61623c92e1a2381c406c0
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/test')
-rw-r--r-- | cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy index 80e74caf75..361167e569 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy @@ -284,17 +284,18 @@ class NetworkCmProxyControllerSpec extends Specification { assert response.contentAsString == '[{"cmHandle":"ch-1","publicCmHandleProperties":[{"color":"yellow"}],"state":null,"trustLevel":"NONE","moduleSetTag":null,"alternateId":null,"dataProducerIdentifier":null},{"cmHandle":"ch-2","publicCmHandleProperties":[{"color":"green"}],"state":null,"trustLevel":null,"moduleSetTag":"someModuleSetTag","alternateId":"someAlternateId","dataProducerIdentifier":"someDataProducerIdentifier"}]' } - def 'Get complete Cm Handle details by Cm Handle id.'() { - given: 'an endpoint and a cm handle' - def cmHandleDetailsEndpoint = "$ncmpBasePathV1/ch/some-cm-handle" + def 'Get complete Cm Handle details by Cm Handle Reference.'() { + given: 'an endpoint and a cm handle reference' + def cmHandleDetailsEndpoint = "$ncmpBasePathV1/ch/some-cm-handle-reference" and: 'an existing ncmp service cm handle' def cmHandleId = 'some-cm-handle' + def alternateId = 'some-alternate-id' def dmiProperties = [prop: 'some DMI property'] def publicProperties = ["public prop": 'some public property'] def compositeState = compositeStateTestObject() - def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, dmiProperties: dmiProperties, publicProperties: publicProperties, compositeState: compositeState, currentTrustLevel: TrustLevel.COMPLETE) - and: 'the service method is invoked with the cm handle id' - 1 * mockNetworkCmProxyInventoryFacade.getNcmpServiceCmHandle('some-cm-handle') >> ncmpServiceCmHandle + def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: alternateId, dmiProperties: dmiProperties, publicProperties: publicProperties, compositeState: compositeState, currentTrustLevel: TrustLevel.COMPLETE) + and: 'the service method is invoked with the cm handle reference' + 1 * mockNetworkCmProxyInventoryFacade.getNcmpServiceCmHandle('some-cm-handle-reference') >> ncmpServiceCmHandle when: 'the cm handle details api is invoked' def response = mvc.perform( get(cmHandleDetailsEndpoint)).andReturn().response |