@Test
public void testGetOrCreateDMNType() {

    final String namespace = "namespace";
    final String typeOneName = "tTypeOne";
    final String typeTwoName = "tTypeTwo";
    final String typeThreeName = "tTypeThree";
    final JSITItemDefinition definition1 = createJSITItemDefinitionMock(typeOneName);
    final JSITItemDefinition definition2 = createJSITItemDefinitionMock(typeTwoName);
    final JSITItemDefinition definition3 = createJSITItemDefinitionMock(typeThreeName);
    final Map<String, JSITItemDefinition> indexed = abstractKogitoDMNServiceSpy.indexDefinitionsByName(Arrays.asList(definition1, definition2, definition3));
    final Map<String, ClientDMNType> createdTypes = new HashMap<>();
    final ClientDMNType dmnTypeOne = mock(ClientDMNType.class);
    final ClientDMNType dmnTypeTwo = mock(ClientDMNType.class);
    final ClientDMNType dmnTypeThree = mock(ClientDMNType.class);
    doReturn(dmnTypeOne).when(abstractKogitoDMNServiceSpy).createDMNType(indexed,
                                                                         definition1,
                                                                         namespace,
                                                                         createdTypes);
    doReturn(dmnTypeTwo).when(abstractKogitoDMNServiceSpy).createDMNType(indexed,
                                                                         definition2,
                                                                         namespace,
                                                                         createdTypes);
    doReturn(dmnTypeThree).when(abstractKogitoDMNServiceSpy).createDMNType(indexed,
                                                                           definition3,
                                                                           namespace,
                                                                           createdTypes);
    final ClientDMNType actualDmnTypeOne = abstractKogitoDMNServiceSpy.getOrCreateDMNType(indexed,
                                                                                          typeOneName,
                                                                                          namespace,
                                                                                          createdTypes);
    final ClientDMNType actualDmnTypeTwo = abstractKogitoDMNServiceSpy.getOrCreateDMNType(indexed,
                                                                                          typeTwoName,
                                                                                          namespace,
                                                                                          createdTypes);
    final ClientDMNType actualDmnTypeThree = abstractKogitoDMNServiceSpy.getOrCreateDMNType(indexed,
                                                                                            typeThreeName,
                                                                                            namespace,
                                                                                            createdTypes);
    assertEquals(dmnTypeOne, actualDmnTypeOne);
    assertEquals(dmnTypeTwo, actualDmnTypeTwo);
    assertEquals(dmnTypeThree, actualDmnTypeThree);
}