TypeConverterProvider implements ITypeConverterProvider { public <TTargetType> ITypeConverter<TTargetType> resolve(Type targetType) { if(!typeConverters.containsKey(targetType)) { throw new TypeConverterNotRegisteredException(String.format("TargetType '%s' has not been registered", targetType)); } return (ITypeConverter<TTargetType>) typeConverters.get(targetType); } TypeConverterProvider(); TypeConverterProvider add(ITypeConverter<TTargetType> typeConverter); ITypeConverter<TTargetType> resolve(Type targetType); TypeConverterProvider override(ITypeConverter<TTargetType> typeConverter); @Override String toString();  }
@Test public void testResolve() throws Exception { Object converter = provider.resolve(Integer.class); Assert.assertNotNull(converter); Assert.assertEquals(converter.getClass(), IntegerConverter.class); }
@Test public void testResolve_NoRegistration() throws Exception { JUnitUtils.assertThrows(() -> provider.resolve(SampleEntity.class)); }