@Test public final void shouldSetProxyEntityInPlaceOfString() throws Exception { when(entity.getField(BELONGS_TO_FIELD_NAME)).thenReturn("1"); ArgumentCaptor<Entity> entityCaptor = ArgumentCaptor.forClass(Entity.class); awesomeDynamicListModelUtils.proxyBelongsToFields(entity); verify(entity, Mockito.times(1)).setField(Mockito.eq(BELONGS_TO_FIELD_NAME), entityCaptor.capture()); assertProxy(entityCaptor.getValue()); }
public final void proxyBelongsToFields(final Entity entity) { DataDefinition dataDefinition = entity.getDataDefinition(); for (Entry<String, FieldDefinition> fieldDefinitionEntry : dataDefinition.getFields().entrySet()) { if (fieldDefinitionEntry.getValue().getType() instanceof BelongsToType) { proxyBelongsToField(fieldDefinitionEntry.getValue(), entity); } } }
AwesomeDynamicListModelUtilsImpl implements AwesomeDynamicListModelUtils { public final void proxyBelongsToFields(final Entity entity) { DataDefinition dataDefinition = entity.getDataDefinition(); for (Entry<String, FieldDefinition> fieldDefinitionEntry : dataDefinition.getFields().entrySet()) { if (fieldDefinitionEntry.getValue().getType() instanceof BelongsToType) { proxyBelongsToField(fieldDefinitionEntry.getValue(), entity); } } } }
AwesomeDynamicListModelUtilsImpl implements AwesomeDynamicListModelUtils { public final void proxyBelongsToFields(final Entity entity) { DataDefinition dataDefinition = entity.getDataDefinition(); for (Entry<String, FieldDefinition> fieldDefinitionEntry : dataDefinition.getFields().entrySet()) { if (fieldDefinitionEntry.getValue().getType() instanceof BelongsToType) { proxyBelongsToField(fieldDefinitionEntry.getValue(), entity); } } }  }
AwesomeDynamicListModelUtilsImpl implements AwesomeDynamicListModelUtils { public final void proxyBelongsToFields(final Entity entity) { DataDefinition dataDefinition = entity.getDataDefinition(); for (Entry<String, FieldDefinition> fieldDefinitionEntry : dataDefinition.getFields().entrySet()) { if (fieldDefinitionEntry.getValue().getType() instanceof BelongsToType) { proxyBelongsToField(fieldDefinitionEntry.getValue(), entity); } } }  final void proxyBelongsToFields(final Entity entity); }
AwesomeDynamicListModelUtilsImpl implements AwesomeDynamicListModelUtils { public final void proxyBelongsToFields(final Entity entity) { DataDefinition dataDefinition = entity.getDataDefinition(); for (Entry<String, FieldDefinition> fieldDefinitionEntry : dataDefinition.getFields().entrySet()) { if (fieldDefinitionEntry.getValue().getType() instanceof BelongsToType) { proxyBelongsToField(fieldDefinitionEntry.getValue(), entity); } } }  final void proxyBelongsToFields(final Entity entity);  }