Merge "Add DMI to TrustLevel Cache During Registration"
authorPriyank Maheshwari <priyank.maheshwari@est.tech>
Mon, 25 Sep 2023 08:44:26 +0000 (08:44 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 25 Sep 2023 08:44:26 +0000 (08:44 +0000)
1  2 
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy

@@@ -26,6 -26,7 +26,7 @@@ package org.onap.cps.ncmp.api.imp
  import com.hazelcast.map.IMap
  import org.onap.cps.ncmp.api.NetworkCmProxyCmHandleQueryService
  import org.onap.cps.ncmp.api.impl.events.lcm.LcmEventsCmHandleStateHandler
+ import org.onap.cps.ncmp.api.impl.trustlevel.TrustLevel
  import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle
  import org.onap.cps.ncmp.api.inventory.CmHandleQueries
  import org.onap.cps.ncmp.api.inventory.CmHandleState
@@@ -72,6 -73,7 +73,7 @@@ class NetworkCmProxyDataServiceImplSpe
      def mockCpsCmHandlerQueryService = Mock(NetworkCmProxyCmHandleQueryService)
      def mockLcmEventsCmHandleStateHandler = Mock(LcmEventsCmHandleStateHandler)
      def stubModuleSyncStartedOnCmHandles = Stub(IMap<String, Object>)
+     def stubTrustLevelPerDmiPlugin = Stub(IMap<String, TrustLevel>)
  
      def NO_TOPIC = null
      def NO_REQUEST_ID = null
@@@ -89,7 -91,8 +91,8 @@@
              mockCpsCmHandlerQueryService,
              mockLcmEventsCmHandleStateHandler,
              mockCpsDataService,
-             stubModuleSyncStartedOnCmHandles)
+             stubModuleSyncStartedOnCmHandles,
+             stubTrustLevelPerDmiPlugin)
  
      def cmHandleXPath = "/dmi-registry/cm-handles[@id='testCmHandle']"
  
          given: 'the system returns a yang modelled cm handle'
              def dmiServiceName = 'some service name'
              def compositeState = new CompositeState(cmHandleState: CmHandleState.ADVISED,
 -                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
 +                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.MODULE_SYNC_FAILED).details("lock details").build(),
                  lastUpdateTime: 'some-timestamp',
                  dataSyncEnabled: false,
                  dataStores: dataStores())
      def 'Get cm handle composite state'() {
          given: 'a yang modelled cm handle'
              def compositeState = new CompositeState(cmHandleState: CmHandleState.ADVISED,
 -                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
 +                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.MODULE_SYNC_FAILED).details("lock details").build(),
                  lastUpdateTime: 'some-timestamp',
                  dataSyncEnabled: false,
                  dataStores: dataStores())