- scenario | dmiPlugin | dmiModelPlugin | dmiDataPlugin || expectedMessageDetails
- 'no DMI plugin' | '' | '' | '' || 'No DMI plugin service names'
- 'all DMI plugins' | 'service1' | 'service2' | 'service3' || 'Invalid combination of plugin service names'
- 'no model DMI plugin' | 'service1' | '' | 'service2' || 'Invalid combination of plugin service names'
- 'no data DMI plugin' | 'service1' | 'service2' | '' || 'Invalid combination of plugin service names'
+ scenario | dmiPlugin | dmiModelPlugin | dmiDataPlugin || expectedMessageDetails
+ 'empty DMI plugins' | '' | '' | '' || 'No DMI plugin service names'
+ 'blank DMI plugins' | ' ' | ' ' | ' ' || 'No DMI plugin service names'
+ 'null DMI plugins' | null | null | null || 'No DMI plugin service names'
+ 'all DMI plugins' | 'service1' | 'service2' | 'service3' || 'Cannot register combined plugin service name and other service names'
+ '(combined)DMI and Data Plugin' | 'service1' | '' | 'service2' || 'Cannot register combined plugin service name and other service names'
+ '(combined)DMI and model Plugin'| 'service1' | 'service2' | '' || 'Cannot register combined plugin service name and other service names'
+ 'only model DMI plugin' | '' | 'service1' | '' || 'Cannot register just a Data or Model plugin service name'
+ 'only data DMI plugin' | '' | '' | 'service1' || 'Cannot register just a Data or Model plugin service name'
+ }
+
+ def 'Exception thrown on CM-Handle registration update request'() {
+ given: 'a CM-handle registration'
+ def objectUnderTest = getObjectUnderTestWithModelSyncDisabled()
+ and: 'dmi plugin registration input update request'
+ def dmiPluginReg = new DmiPluginRegistration();
+ dmiPluginReg.dmiPlugin = 'onap.dmap.plugin';
+ dmiPluginReg.updatedCmHandles = [new CmHandle(cmHandleID: 'unknownHandle')]
+ and: 'update data node leaves is unable to find data node'
+ mockNetworkCmProxyDataServicePropertyHandler.updateCmHandleProperties(*_) >> { throw new DataNodeNotFoundException('NCMP-Admin', 'ncmp-dmi-registry') }
+ when: 'update dmi registration is called'
+ objectUnderTest.updateDmiRegistrationAndSyncModule(dmiPluginReg)
+ then: 'data validation exception is thrown'
+ def exceptionThrown = thrown(DataValidationException.class)
+ assert exceptionThrown.getDetails().contains('DataNode not found')