import org.onap.cps.ncmp.api.inventory.CmHandleState
import org.onap.cps.ncmp.api.inventory.CompositeStateBuilder
import org.onap.cps.ncmp.api.inventory.LockReasonCategory
+import org.onap.cps.ncmp.api.inventory.SyncState
import org.onap.cps.ncmp.rest.model.RestOutputCmHandleState
import spock.lang.Specification
.withCmHandleState(CmHandleState.ADVISED)
.withLastUpdatedTime(formattedDateAndTime.toString())
.withLockReason(LockReasonCategory.LOCKED_MISBEHAVING, 'locked other details')
- .withOperationalDataStores('SYNCHRONIZED', formattedDateAndTime).build()
+ .withOperationalDataStores(SyncState.SYNCHRONIZED, formattedDateAndTime).build()
compositeState.setDataSyncEnabled(false)
when: 'mapper is called'
def result = objectUnderTest.toRestOutputCmHandleState(compositeState)
assert result.lastUpdateTime == formattedDateAndTime
assert result.lockReason.reason == 'LOCKED_MISBEHAVING'
assert result.lockReason.details == 'locked other details'
- assert result.cmHandleState == CmHandleState.ADVISED.name()
+ assert result.cmHandleState == 'ADVISED'
assert result.dataSyncState.operational.getState() != null
}