diff options
author | seanbeirne <sean.beirne@est.tech> | 2023-11-09 11:00:47 +0000 |
---|---|---|
committer | seanbeirne <sean.beirne@est.tech> | 2023-11-13 10:21:22 +0000 |
commit | 4d2894f9856c701e7cd15c69f4e26ee41cfd1a72 (patch) | |
tree | 414ea1737a5b6ef12ec992bea84302e863ea0843 /cps-ncmp-service/src/test | |
parent | c7da68167b61674566e165955cbd9f518b32d02e (diff) |
Add DMI trustlevel at registration
-Re-introduce trustLevelPerDmiPlugin to registration process
Issue-ID: CPS-1902
Signed-off-by: seanbeirne <sean.beirne@est.tech>
Change-Id: Ic3f154aca60c3e1244ff4fd9a4c4865964884b31
Diffstat (limited to 'cps-ncmp-service/src/test')
2 files changed, 11 insertions, 5 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplRegistrationSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplRegistrationSpec.groovy index 5588ec7811..9f15e1fa56 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplRegistrationSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplRegistrationSpec.groovy @@ -69,6 +69,7 @@ class NetworkCmProxyDataServiceImplRegistrationSpec extends Specification { def mockCpsDataService = Mock(CpsDataService) def mockModuleSyncStartedOnCmHandles = Mock(IMap<String, Object>) def trustLevelPerCmHandle = [:] + def trustLevelPerDmiPlugin = [:] def objectUnderTest = getObjectUnderTest() def 'DMI Registration: Create, Update, Delete & Upgrade operations are processed in the right order'() { @@ -160,11 +161,14 @@ class NetworkCmProxyDataServiceImplRegistrationSpec extends Specification { objectUnderTest.updateDmiRegistrationAndSyncModule(dmiPluginRegistration) then: 'create cm handles registration and sync modules is called with the correct plugin information' 1 * objectUnderTest.parseAndProcessCreatedCmHandlesInRegistration(dmiPluginRegistration) + and: 'dmi is added to the dmi trustLevel map' + assert trustLevelPerDmiPlugin.size() == 1 + assert trustLevelPerDmiPlugin.containsKey(expectedDmiPluginRegisteredName) where: - scenario | dmiPlugin | dmiModelPlugin | dmiDataPlugin - 'combined DMI plugin' | 'service1' | '' | '' - 'data & model DMI plugins' | '' | 'service1' | 'service2' - 'data & model using same service' | '' | 'service1' | 'service1' + scenario | dmiPlugin | dmiModelPlugin | dmiDataPlugin || expectedDmiPluginRegisteredName + 'combined DMI plugin' | 'service1' | '' | '' || 'service1' + 'data & model DMI plugins' | '' | 'service1' | 'service2' || 'service2' + 'data & model using same service' | '' | 'service1' | 'service1' || 'service1' } def 'Create CM-handle Validation: Invalid DMI plugin service name with #scenario'() { @@ -435,7 +439,7 @@ class NetworkCmProxyDataServiceImplRegistrationSpec extends Specification { return Spy(new NetworkCmProxyDataServiceImpl(spiedJsonObjectMapper, mockDmiDataOperations, mockNetworkCmProxyDataServicePropertyHandler, mockInventoryPersistence, mockCmHandleQueries, stubbedNetworkCmProxyCmHandlerQueryService, mockLcmEventsCmHandleStateHandler, mockCpsDataService, - mockModuleSyncStartedOnCmHandles, trustLevelPerCmHandle)) + mockModuleSyncStartedOnCmHandles, trustLevelPerCmHandle, trustLevelPerDmiPlugin)) } def addPersistedYangModelCmHandles(ids) { diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy index af65cfc1a2..71511cc161 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy @@ -76,6 +76,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { def mockCpsCmHandlerQueryService = Mock(NetworkCmProxyCmHandleQueryService) def mockLcmEventsCmHandleStateHandler = Mock(LcmEventsCmHandleStateHandler) def stubModuleSyncStartedOnCmHandles = Stub(IMap<String, Object>) + def stubTrustLevelPerCmHandle = Stub(Map<String, TrustLevel>) def stubTrustLevelPerDmiPlugin = Stub(Map<String, TrustLevel>) def NO_TOPIC = null @@ -95,6 +96,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification { mockLcmEventsCmHandleStateHandler, mockCpsDataService, stubModuleSyncStartedOnCmHandles, + stubTrustLevelPerCmHandle, stubTrustLevelPerDmiPlugin) def cmHandleXPath = "/dmi-registry/cm-handles[@id='testCmHandle']" |