@Test public void testGetSubDataTypeStack() { final DataType dataType = mock(DataType.class); final String uuid = "uuid"; when(typeStack.get(uuid)).thenReturn(asList("tPerson", "tCompany")); when(dataType.getUUID()).thenReturn(uuid); when(dataType.getType()).thenReturn("tCity"); doReturn(dataType).when(manager).getDataType(); final List<String> actualTypeStack = manager.getSubDataTypeStack(); final List<String> expectedTypeStack = asList("tPerson", "tCompany", "tCity"); assertEquals(expectedTypeStack, actualTypeStack); }
List<String> getSubDataTypeStack() { final List<String> subDataTypeStack = new ArrayList<>(getTypeStack()); getStackType().ifPresent(subDataTypeStack::add); return subDataTypeStack; }
DataTypeManager { List<String> getSubDataTypeStack() { final List<String> subDataTypeStack = new ArrayList<>(getTypeStack()); getStackType().ifPresent(subDataTypeStack::add); return subDataTypeStack; } }
DataTypeManager { List<String> getSubDataTypeStack() { final List<String> subDataTypeStack = new ArrayList<>(getTypeStack()); getStackType().ifPresent(subDataTypeStack::add); return subDataTypeStack; } @Inject  DataTypeManager(final TranslationService translationService,
                           final ItemDefinitionRecordEngine recordEngine,
                           final ItemDefinitionStore itemDefinitionStore,
                           final DataTypeStore dataTypeStore,
                           final ItemDefinitionUtils itemDefinitionUtils,
                           final ManagedInstance<DataTypeManager> dataTypeManagers,
                           final DataTypeNameValidator dataTypeNameValidator,
                           final DataTypeManagerStackStore typeStack); }
DataTypeManager { List<String> getSubDataTypeStack() { final List<String> subDataTypeStack = new ArrayList<>(getTypeStack()); getStackType().ifPresent(subDataTypeStack::add); return subDataTypeStack; } @Inject  DataTypeManager(final TranslationService translationService,
                           final ItemDefinitionRecordEngine recordEngine,
                           final ItemDefinitionStore itemDefinitionStore,
                           final DataTypeStore dataTypeStore,
                           final ItemDefinitionUtils itemDefinitionUtils,
                           final ManagedInstance<DataTypeManager> dataTypeManagers,
                           final DataTypeNameValidator dataTypeNameValidator,
                           final DataTypeManagerStackStore typeStack); DataTypeManager fromNew(); DataTypeManager from(final ItemDefinition itemDefinition); DataTypeManager from(final BuiltInType builtInType); DataTypeManager from(final DataType dataType); DataTypeManager withParentUUID(final String parentUUID); DataTypeManager withName(final String name); DataTypeManager withType(final String type); DataTypeManager withConstraint(final String constraint); DataTypeManager withConstraintType(final String constraintType); DataTypeManager asList(final boolean isCollection); DataTypeManager withNoConstraint(); DataTypeManager withDataType(final DataType dataType); DataTypeManager withItemDefinition(final ItemDefinition itemDefinition); DataTypeManager withRefreshedSubDataTypes(final String newType); DataTypeManager withSubDataTypes(final List<DataType> dataTypes); DataTypeManager withNoName(); DataTypeManager withUniqueName(); DataTypeManager withUniqueName(final String name); DataTypeManager withItemDefinitionSubDataTypes(); DataTypeManager withIndexedItemDefinition(); DataType get(); List<DataType> makeExternalDataTypes(final String typeName); String structure(); String getTypeName(); DataTypeManager asStructure(); Optional<DataType> getTopLevelDataTypeWithName(final String typeName); }
DataTypeManager { List<String> getSubDataTypeStack() { final List<String> subDataTypeStack = new ArrayList<>(getTypeStack()); getStackType().ifPresent(subDataTypeStack::add); return subDataTypeStack; } @Inject  DataTypeManager(final TranslationService translationService,
                           final ItemDefinitionRecordEngine recordEngine,
                           final ItemDefinitionStore itemDefinitionStore,
                           final DataTypeStore dataTypeStore,
                           final ItemDefinitionUtils itemDefinitionUtils,
                           final ManagedInstance<DataTypeManager> dataTypeManagers,
                           final DataTypeNameValidator dataTypeNameValidator,
                           final DataTypeManagerStackStore typeStack); DataTypeManager fromNew(); DataTypeManager from(final ItemDefinition itemDefinition); DataTypeManager from(final BuiltInType builtInType); DataTypeManager from(final DataType dataType); DataTypeManager withParentUUID(final String parentUUID); DataTypeManager withName(final String name); DataTypeManager withType(final String type); DataTypeManager withConstraint(final String constraint); DataTypeManager withConstraintType(final String constraintType); DataTypeManager asList(final boolean isCollection); DataTypeManager withNoConstraint(); DataTypeManager withDataType(final DataType dataType); DataTypeManager withItemDefinition(final ItemDefinition itemDefinition); DataTypeManager withRefreshedSubDataTypes(final String newType); DataTypeManager withSubDataTypes(final List<DataType> dataTypes); DataTypeManager withNoName(); DataTypeManager withUniqueName(); DataTypeManager withUniqueName(final String name); DataTypeManager withItemDefinitionSubDataTypes(); DataTypeManager withIndexedItemDefinition(); DataType get(); List<DataType> makeExternalDataTypes(final String typeName); String structure(); String getTypeName(); DataTypeManager asStructure(); Optional<DataType> getTopLevelDataTypeWithName(final String typeName);  }