use of io.atlasmap.converters.StringConverter in project atlasmap by atlasmap.
the class DefaultAtlasConversionServiceTest method findMatchingConverterByFieldTypes.
@Test
public void findMatchingConverterByFieldTypes() {
assertNotNull(service);
Optional<AtlasConverter<?>> atlasConverter = service.findMatchingConverter(FieldType.STRING, FieldType.BOOLEAN);
assertTrue(atlasConverter.isPresent());
assertNotNull(atlasConverter);
assertEquals(StringConverter.class, atlasConverter.get().getClass());
StringConverter stringConverter = (StringConverter) atlasConverter.get();
assertNotNull(stringConverter);
assertThat("io.atlasmap.converters.StringConverter", is(atlasConverter.get().getClass().getCanonicalName()));
Boolean t = stringConverter.toBoolean("T", null, null);
assertNotNull(t);
assertTrue(t);
Boolean f = stringConverter.toBoolean("F", null, null);
assertNotNull(f);
assertFalse(f);
service.findMatchingConverter(null, FieldType.BOOLEAN);
service.findMatchingConverter(FieldType.STRING, null);
FieldType fieldType = null;
service.findMatchingConverter(fieldType, fieldType);
}
Aggregations