@Test public void convertListShouldReturnEmptyListWhenEmptyListIsGivenAsSourceList() { List<TestClass1> emptySourceList = Collections.emptyList(); List<TestClass2> result = modelMapperConverterService.convert(emptySourceList, TestClass2.class); assertThat(result, notNullValue()); assertThat(result, empty()); }
@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);  }