@Test(expected = IllegalArgumentException.class) public void convertListShouldThrowIllegalArgumentExceptionWhenTargetTypeParameterIsNull() { List<TestClass1> sourceList = Collections.singletonList(new TestClass1(TEST_CLASS_FIRST_ID)); modelMapperConverterService.convert(sourceList, null); }
@Override public <S, T> T convert(S source, Class<T> targetType) { Assert.notNull(source); Assert.notNull(targetType); return modelMapper.map(source, targetType); }
ModelMapperConverterServiceImpl implements ConverterService { @Override public <S, T> T convert(S source, Class<T> targetType) { Assert.notNull(source); Assert.notNull(targetType); return modelMapper.map(source, targetType); } }
ModelMapperConverterServiceImpl implements ConverterService { @Override public <S, T> T convert(S source, Class<T> targetType) { Assert.notNull(source); Assert.notNull(targetType); return modelMapper.map(source, targetType); } ModelMapperConverterServiceImpl(ModelMapper modelMapper); }
ModelMapperConverterServiceImpl implements ConverterService { @Override public <S, T> T convert(S source, Class<T> targetType) { Assert.notNull(source); Assert.notNull(targetType); return modelMapper.map(source, targetType); } ModelMapperConverterServiceImpl(ModelMapper modelMapper); void setupCustomConverters(List<ConverterAdapter> converterAdapters); @Override T convert(S source, Class<T> targetType); @Override List<T> convert(List<S> sourceList, Class<T> targetType); }
ModelMapperConverterServiceImpl implements ConverterService { @Override public <S, T> T convert(S source, Class<T> targetType) { Assert.notNull(source); Assert.notNull(targetType); return modelMapper.map(source, targetType); } ModelMapperConverterServiceImpl(ModelMapper modelMapper); void setupCustomConverters(List<ConverterAdapter> converterAdapters); @Override T convert(S source, Class<T> targetType); @Override List<T> convert(List<S> sourceList, Class<T> targetType);  }