### Question:
DataTypeUpdateHandler extends DataTypeHandler { void refreshSubDataType(final DataType dataType, final String newType) { final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID()); dataTypeManager.from(dataType).withType(newType); recordEngine.doUpdate(dataType, itemDefinition); refreshSubDataTypes(dataType, dataType.getType()); } @Inject  DataTypeUpdateHandler(final ItemDefinitionStore itemDefinitionStore,
                                 final DataTypeStore dataTypeStore,
                                 final DataTypeManager dataTypeManager); void update(final DataType dataType); List<DataType> refreshDependentDataTypes(final DataType dataType,
                                                    final String oldItemDefinitionName);  }### Answer:
@Test public void testRefreshSubDataType() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); final String newType = "newType"; final String type = "type"; final String uuid = "uuid"; when(dataType.getType()).thenReturn(type); when(dataType.getUUID()).thenReturn(uuid); when(itemDefinitionStore.get(uuid)).thenReturn(itemDefinition); when(dataTypeManager.from(dataType)).thenReturn(dataTypeManager); when(dataTypeManager.withType(newType)).thenReturn(dataTypeManager); handler.refreshSubDataType(dataType, newType); final InOrder inOrder = Mockito.inOrder(dataTypeManager, dataTypeManager, recordEngine, handler); inOrder.verify(dataTypeManager).from(dataType); inOrder.verify(dataTypeManager).withType(newType); inOrder.verify(recordEngine).doUpdate(dataType, itemDefinition); inOrder.verify(handler).refreshSubDataTypes(dataType, type); }