diff options
author | Priyank Maheshwari <priyank.maheshwari@est.tech> | 2024-09-04 07:57:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-09-04 07:57:04 +0000 |
commit | 7045c11f9b7a49c9b711a2a61b299bf886dc0836 (patch) | |
tree | 953bde2a0129dba60339abe41ff012d3de2ae6e5 /cps-ncmp-service/src/test/groovy | |
parent | 582da21cb7c66b5b5f877dde4fac3de58d3cb1cb (diff) | |
parent | 081f605d960fcba79a82e8dfe70c4b20e232ea94 (diff) |
Merge "Support Alternate-id for CPS-E05 module definition"
Diffstat (limited to 'cps-ncmp-service/src/test/groovy')
-rw-r--r-- | cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/inventory/NetworkCmProxyInventoryFacadeSpec.groovy | 26 |
1 files changed, 19 insertions, 7 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 9d51fff05a..3352c264a2 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 @@ -198,18 +198,30 @@ class NetworkCmProxyInventoryFacadeSpec extends Specification { assert result == ['cm-handle-id-1'] } - def 'Getting module definitions by module'() { - when: 'get module definitions is performed with module name' - objectUnderTest.getModuleDefinitionsByCmHandleAndModule('some-cm-handle', 'some-module', '2021-08-04') - then: 'ncmp inventory persistence service is invoked once with correct parameters' + def 'Getting module definitions by module for a given #scenario'() { + when: 'get module definitions is performed with module name and cm handle reference' + objectUnderTest.getModuleDefinitionsByCmHandleAndModule(cmHandleRef, 'some-module', '2021-08-04') + then: 'alternate id matcher returns some cm handle id for a given cm handle reference' + mockAlternateIdMatcher.getCmHandleId(cmHandleRef) >> 'some-cm-handle' + and: 'ncmp inventory persistence service is invoked once with correct parameters' 1 * mockInventoryPersistence.getModuleDefinitionsByCmHandleAndModule('some-cm-handle', 'some-module', '2021-08-04') + 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 'Getting module definitions by cm handle id'() { - when: 'get module definitions is performed with cm handle id' - objectUnderTest.getModuleDefinitionsByCmHandleId('some-cm-handle') + def 'Getting module definitions for a given #scenario'() { + when: 'get module definitions is performed with cm handle reference' + objectUnderTest.getModuleDefinitionsByCmHandleReference(cmHandleRef) + then: 'alternate id matcher returns some cm handle id for a given cm handle reference' + mockAlternateIdMatcher.getCmHandleId(cmHandleRef) >> 'some-cm-handle' then: 'ncmp inventory persistence service is invoked once with correct parameter' 1 * mockInventoryPersistence.getModuleDefinitionsByCmHandleId('some-cm-handle') + 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 'Execute cm handle search'() { |