- scenario | isReadyForRetry || expectedNumberOfInvocationsToSaveCmHandleState
- 'retry locked cm handle once' | [true, false] || 1
- 'retry locked cm handle twice' | [true, true] || 2
- 'do not retry locked cm handle' | [false, false] || 0
+ scenario | isReadyForRetry | inProgressMapSize || expectedNumberOfInvocationsToUpdateCmHandleState
+ 'retry locked cm handle' | [true, false] | 1 || 1
+ 'do not retry locked cm handle' | [false, false] | 2 || 0
+ }
+
+ def 'Module Sync ADVISED cm handle without entry in progress map.'() {
+ given: 'cm handles in an ADVISED state'
+ def cmHandle1 = advisedCmHandleAsDataNode('cm-handle-1')
+ and: 'the inventory persistence cm handle returns a ADVISED state for the any handle'
+ mockInventoryPersistence.getCmHandleState(_) >> new CompositeState(cmHandleState: CmHandleState.ADVISED)
+ and: 'entry in progress map for other cm handle'
+ moduleSyncStartedOnCmHandles.put('other-cm-handle', 'started')
+ when: 'module sync poll is executed'
+ objectUnderTest.performModuleSync([cmHandle1], batchCount)
+ then: 'module sync service is invoked for cm handle'
+ 1 * mockModuleSyncService.syncAndCreateOrUpgradeSchemaSetAndAnchor(_) >> { args -> assertYamgModelCmHandleArgument(args, 'cm-handle-1') }
+ and: 'the entry for other cm handle is still in the progress map'
+ assert moduleSyncStartedOnCmHandles.get('other-cm-handle') != null