@Test
public void testGetCustomWithItemComponentDMNTypes() {

    // tPeople[structure]
    //    address[structure]
    //       country[string]
    final JSITItemDefinition tPeople = mock(JSITItemDefinition.class);
    final String tPeopleType = "tPeopleType";
    final String addressFieldName = "address";
    final String countryFieldName = "country";
    when(tPeople.getName()).thenReturn(tPeopleType);
    final JSITItemDefinition address = mock(JSITItemDefinition.class);
    when(address.getName()).thenReturn(addressFieldName);
    final List<JSITItemDefinition> tPeopleFields = Arrays.asList(address);
    final JSITItemDefinition country = mock(JSITItemDefinition.class);
    when(country.getName()).thenReturn(countryFieldName);
    when(country.getTypeRef()).thenReturn(BuiltInType.STRING.getName());
    final List<JSITItemDefinition> tAddressFields = Arrays.asList(country);
    when(tPeople.getItemComponent()).thenReturn(tPeopleFields);
    when(address.getItemComponent()).thenReturn(tAddressFields);
    final List<JSITItemDefinition> definitions = Arrays.asList(tPeople);
    final Map<String, ClientDMNType> dmnTypesMap = abstractKogitoDMNServiceSpy.getDMNDataTypesMap(definitions, "namespace");
    assertTrue(dmnTypesMap.containsKey(tPeopleType));
    final ClientDMNType dmnPeopleType = dmnTypesMap.get(tPeopleType);
    assertEquals(1, dmnPeopleType.getFields().size());
    assertTrue(dmnPeopleType.getFields().containsKey(addressFieldName));
    assertNull(dmnPeopleType.getFeelType());
    assertFalse(dmnPeopleType.isCollection());
    assertTrue(dmnPeopleType.isComposite());
    ClientDMNType addressType = dmnPeopleType.getFields().get(addressFieldName);
    assertNotNull(addressType);
    assertEquals(1, addressType.getFields().size());
    assertTrue(addressType.getFields().containsKey(countryFieldName));
    assertNull(addressType.getFeelType());
    assertFalse(addressType.isCollection());
    assertTrue(addressType.isComposite());
    ClientDMNType countryType = addressType.getFields().get(countryFieldName);
    assertEquals(0, countryType.getFields().size());
    assertEquals(BuiltInType.STRING, countryType.getFeelType());
    assertFalse(countryType.isCollection());
    assertFalse(countryType.isComposite());
    // It must contains all elements defined in BuiltInType ENUM
    assertTrue(dmnTypesMap.size() == 15);
    for (BuiltInType builtInType : BuiltInType.values()) {
        Arrays.stream(builtInType.getNames()).forEach(name -> assertNotNull(dmnTypesMap.get(name)));
    }
}