use of org.mapstruct.ap.testutil.ProcessorTest in project mapstruct by mapstruct.
the class Issue1801Test method shouldIncludeBuildeType.
@ProcessorTest
public void shouldIncludeBuildeType() {
ItemDTO item = ImmutableItemDTO.builder().id("test").build();
Item target = ItemMapper.INSTANCE.map(item);
assertThat(target).isNotNull();
assertThat(target.getId()).isEqualTo("test");
}
use of org.mapstruct.ap.testutil.ProcessorTest in project mapstruct by mapstruct.
the class Issue2170Test method shouldGenerateCodeThatCompiles.
@ProcessorTest
public void shouldGenerateCodeThatCompiles() {
AddressDto addressDto = AddressMapper.INSTANCE.toDto(new Address("10000", Collections.singletonList(new Person("Tester"))));
assertThat(addressDto).isNotNull();
assertThat(addressDto.getZipCode()).isEqualTo("10000");
assertThat(addressDto.getPeople()).extracting(PersonDto::getName).containsExactly("Tester");
}
use of org.mapstruct.ap.testutil.ProcessorTest in project mapstruct by mapstruct.
the class Issue2195Test method test.
@ProcessorTest
@WithClasses(Issue2195Mapper.class)
public void test() {
Source source = new Source();
source.setName("JohnDoe");
TargetBase target = Issue2195Mapper.INSTANCE.map(source);
assertThat(target).isInstanceOf(Target.class);
}
use of org.mapstruct.ap.testutil.ProcessorTest in project mapstruct by mapstruct.
the class Issue2544Test method shouldConvertEn.
// Parsing numbers is sensitive to locale settings (e.g. decimal point)
@ProcessorTest
@DefaultLocale("en")
public void shouldConvertEn() {
Issue2544Mapper.Target target = Issue2544Mapper.INSTANCE.map("123.45679E6");
assertThat(target).isNotNull();
assertThat(target.getBigNumber()).isEqualTo(new BigDecimal("1.2345679E+8"));
}
use of org.mapstruct.ap.testutil.ProcessorTest in project mapstruct by mapstruct.
the class Issue2544Test method shouldConvertDe.
@ProcessorTest
@DefaultLocale("de")
public void shouldConvertDe() {
Issue2544Mapper.Target target = Issue2544Mapper.INSTANCE.map("123,45679E6");
assertThat(target).isNotNull();
assertThat(target.getBigNumber()).isEqualTo(new BigDecimal("1.2345679E+8"));
}
Aggregations