use of org.mapstruct.ap.test.injectionstrategy.shared.CustomerEntity in project mapstruct by mapstruct.
the class Jsr330CompileOptionConstructorMapperTest method shouldConvertToTarget.
@ProcessorTest
public void shouldConvertToTarget() {
// given
CustomerEntity customerEntity = new CustomerEntity();
customerEntity.setName("Samuel");
customerEntity.setGender(Gender.MALE);
// when
CustomerDto customerDto = customerMapper.asTarget(customerEntity);
// then
assertThat(customerDto).isNotNull();
assertThat(customerDto.getName()).isEqualTo("Samuel");
assertThat(customerDto.getGender()).isEqualTo(GenderDto.M);
}
use of org.mapstruct.ap.test.injectionstrategy.shared.CustomerEntity in project mapstruct by mapstruct.
the class Jsr330FieldMapperTest method shouldConvertToTarget.
@ProcessorTest
public void shouldConvertToTarget() {
// given
CustomerEntity customerEntity = new CustomerEntity();
customerEntity.setName("Samuel");
customerEntity.setGender(Gender.MALE);
// when
CustomerDto customerDto = customerMapper.asTarget(customerEntity);
// then
assertThat(customerDto).isNotNull();
assertThat(customerDto.getName()).isEqualTo("Samuel");
assertThat(customerDto.getGender()).isEqualTo(GenderDto.M);
}
use of org.mapstruct.ap.test.injectionstrategy.shared.CustomerEntity in project mapstruct by mapstruct.
the class SpringDefaultMapperTest method shouldConvertToTarget.
@ProcessorTest
public void shouldConvertToTarget() {
// given
CustomerEntity customerEntity = new CustomerEntity();
customerEntity.setName("Samuel");
customerEntity.setGender(Gender.MALE);
// when
CustomerDto customerDto = customerMapper.asTarget(customerEntity);
// then
assertThat(customerDto).isNotNull();
assertThat(customerDto.getName()).isEqualTo("Samuel");
assertThat(customerDto.getGender()).isEqualTo(GenderDto.M);
}
Aggregations