Search in sources :

Example 1 with DriverAndCarDto

use of org.mapstruct.ap.test.nullvaluemapping._target.DriverAndCarDto in project mapstruct by mapstruct.

the class NullValueMappingTest method shouldApplyConfiguredStrategyForMethodWithSeveralSourceParams.

@ProcessorTest
public void shouldApplyConfiguredStrategyForMethodWithSeveralSourceParams() {
    // when
    DriverAndCarDto result = CarMapper.INSTANCE.driverAndCarToDto(null, null);
    // then
    assertThat(result).isNotNull();
    assertThat(result.getMake()).isNull();
    assertThat(result.getName()).isNull();
    // when
    result = CarMapper.INSTANCE.driverAndCarToDtoReturningNull(null, null);
    // then
    assertThat(result).isNull();
}
Also used : DriverAndCarDto(org.mapstruct.ap.test.nullvaluemapping._target.DriverAndCarDto) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

DriverAndCarDto (org.mapstruct.ap.test.nullvaluemapping._target.DriverAndCarDto)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1