- def 'Attempt to update a cmhandle with an already cached alternate id.'() {
- given: 'cm handles request'
- def cmHandleUpdateRequest = [new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: 'my alternate id')]
- and: 'the id already added to the alternate id cache'
- mockCmHandleIdMapper.isDuplicateId(cmHandleId, 'my alternate id') >> true
- when: 'update data node leaves is called using correct parameters'
- def response = objectUnderTest.updateCmHandleProperties(cmHandleUpdateRequest)
- then: 'one failed registration response'
- response.size() == 1
- and: 'it has expected error details'
- with(response.get(0)) {
- assert it.status == Status.FAILURE
- assert it.cmHandle == cmHandleId
- assert it.ncmpResponseStatus == ALTERNATE_ID_ALREADY_ASSOCIATED
- assert it.errorText.contains('cannot re-assign')
- }
- }
-