def setup() {
// always accept all cm handles
- mockAlternateIdChecker.getIdsOfCmHandlesWithRejectedAlternateId(_) >> []
+ mockAlternateIdChecker.getIdsOfCmHandlesWithRejectedAlternateId(*_) >> []
// always can find all cm handles in DB
mockInventoryPersistence.getYangModelCmHandles(_) >> { args -> args[0].collect { new YangModelCmHandle(id:it) } }
'an unexpected exception' | 'cmhandle' | new RuntimeException('Failed') || UNKNOWN_ERROR | 'Failed'
}
- def 'Adding data to alternate id caches.'() {
- given: 'a registration with three CM Handles to be created'
- def ncmpServiceCmHandles = [new NcmpServiceCmHandle(cmHandleId: 'cmhandle1', alternateId: 'my-alternate-id-1')]
- def dmiPluginRegistration = new DmiPluginRegistration(dmiPlugin: 'my-server', createdCmHandles: ncmpServiceCmHandles)
- when: 'the DMI plugin registration happens'
- objectUnderTest.updateDmiRegistrationAndSyncModule(dmiPluginRegistration)
- then: 'the new alternate id is added to the cache'
- 1 * mockAlternateIdChecker.getIdsOfCmHandlesWithRejectedAlternateId(ncmpServiceCmHandles) >> ['cmhandle1']
- }
-
}