+ def 'Resolve dmi service name: #scenario and #requiredService service require.'() {
+ given: 'a Persistence CM Handle'
+ def objectUnderTest = PersistenceCmHandle.toPersistenceCmHandle(dmiServiceName, dmiDataServiceName, dmiModelServiceName, new CmHandle('some id', null))
+ expect:
+ assert objectUnderTest.resolveDmiServiceName(requiredService) == expectedService
+ where:
+ scenario | dmiServiceName | dmiDataServiceName | dmiModelServiceName | requiredService || expectedService
+ 'common service registered' | 'common service' | 'does not matter' | 'does not matter' | DATA || 'common service'
+ 'common service registered' | 'common service' | 'does not matter' | 'does not matter' | MODEL || 'common service'
+ 'common service empty' | '' | 'data service' | 'does not matter' | DATA || 'data service'
+ 'common service empty' | '' | 'does not matter' | 'model service' | MODEL || 'model service'
+ 'common service blank' | ' ' | 'data service' | 'does not matter' | DATA || 'data service'
+ 'common service blank' | ' ' | 'does not matter' | 'model service' | MODEL || 'model service'
+ 'common service null ' | null | 'data service' | 'does not matter' | DATA || 'data service'
+ 'common service null' | null | 'does not matter' | 'model service' | MODEL || 'model service'
+ 'only model service registered' | null | null | 'does not matter' | DATA || null
+ 'only data service registered' | null | 'does not matter' | null | MODEL || null
+ }
+