DeferredValueSupport { public Converter resolveConverter(Class<?> targetEntityType, String targetPropertyName, Class<?> targetValueType) { SingleFieldMapping mapping = _schemaCache.getFieldMappingForCsvFieldName( targetEntityType, targetPropertyName); if (mapping == null) { mapping = _schemaCache.getFieldMappingForObjectFieldName( targetEntityType, targetPropertyName); } if (mapping != null) { if (mapping instanceof ConverterFactory) { ConverterFactory factory = (ConverterFactory) mapping; return factory.create(_reader.getContext()); } if (mapping instanceof Converter) { return (Converter) mapping; } } return ConvertUtils.lookup(targetValueType); } DeferredValueSupport(GtfsReader reader, EntitySchemaCache schemaCache); GtfsReader getReader(); AgencyAndId resolveAgencyAndId(BeanWrapper bean, String propertyName,
      String newId); Converter resolveConverter(Class<?> targetEntityType,
      String targetPropertyName, Class<?> targetValueType);  }
@Test public void testResolveConverter() { Converter converter = _support.resolveConverter(Object.class, "xyz", String.class); assertSame(ConvertUtils.lookup(String.class), converter); }
@Test public void testResolveConverter_FieldMappingConverter() { EntitySchema schema = new EntitySchema(Object.class, "object.txt", false); FieldMappingAndConverter field = mock(FieldMappingAndConverter.class); when(field.getCsvFieldName()).thenReturn("xyz"); schema.addField(field); _schemaCache.addEntitySchema(schema); Converter converter = _support.resolveConverter(Object.class, "xyz", String.class); assertSame(field, converter); }