+ def 'Internal to External Lock Reason Mapping of #scenario'() {
+ given: 'a LOCKED composite state with locked reason of #scenario'
+ def compositeState = new CompositeStateBuilder()
+ .withCmHandleState(CmHandleState.LOCKED)
+ .withLockReason(lockReason, '').build()
+ when: 'the composite state is mapped to a CMHandle composite state'
+ def result = objectUnderTest.toCmHandleCompositeStateExternalLockReason(compositeState)
+ then: 'the composite state contains the expected lock Reason and details'
+ result.getLockReason().getReason() == expectedExternalLockReason
+ where:
+ scenario | lockReason || expectedExternalLockReason
+ 'LOCKED_MODULE_SYNC_FAILED' | LockReasonCategory.LOCKED_MODULE_SYNC_FAILED || 'LOCKED_MISBEHAVING'
+ 'null value' | null || null
+ }
+