BAEL-6572: Modified dto to remove lombok annotation as per guidelines and review comment
This commit is contained in:
@@ -17,9 +17,9 @@ class LicenseMapperUnitTest {
|
||||
|
||||
@Test
|
||||
void givenLicenseDtoWithStartDateAndWithoutEndDate_WhenMapperMethodIsInvoked_ThenLicenseShouldBePopulatedWithDefaultEndDate() {
|
||||
License license = licenseMapper.toLicense(LicenseDto.builder()
|
||||
.startDate(LocalDateTime.now())
|
||||
.build());
|
||||
LicenseDto licenseDto = new LicenseDto();
|
||||
licenseDto.setStartDate(LocalDateTime.now());
|
||||
License license = licenseMapper.toLicense(licenseDto);
|
||||
assertThat(license).isNotNull();
|
||||
assertThat(license.getEndDate()
|
||||
.toLocalDate()).isEqualTo(LocalDate.now()
|
||||
@@ -28,10 +28,10 @@ class LicenseMapperUnitTest {
|
||||
|
||||
@Test
|
||||
void givenLicenseDtoWithEndDateAndWithoutStartDate_WhenMapperMethodIsInvoked_ThenLicenseShouldBePopulatedWithDefaultStartDate() {
|
||||
License license = licenseMapper.toLicense(LicenseDto.builder()
|
||||
.endDate(LocalDateTime.now()
|
||||
.plusYears(2))
|
||||
.build());
|
||||
LicenseDto licenseDto = new LicenseDto();
|
||||
licenseDto.setEndDate(LocalDateTime.now()
|
||||
.plusYears(2));
|
||||
License license = licenseMapper.toLicense(licenseDto);
|
||||
assertThat(license).isNotNull();
|
||||
assertThat(license.getStartDate()
|
||||
.toLocalDate()).isEqualTo(LocalDate.now());
|
||||
@@ -39,8 +39,8 @@ class LicenseMapperUnitTest {
|
||||
|
||||
@Test
|
||||
void givenLicenseDtoWithoutStartDateAndEndDate_WhenMapperMethodIsInvoked_ThenLicenseShouldBePopulatedWithDefaultDetails() {
|
||||
License license = licenseMapper.toLicense(LicenseDto.builder()
|
||||
.build());
|
||||
LicenseDto licenseDto = new LicenseDto();
|
||||
License license = licenseMapper.toLicense(licenseDto);
|
||||
assertThat(license).isNotNull();
|
||||
assertThat(license.getStartDate()
|
||||
.toLocalDate()).isEqualTo(LocalDate.now());
|
||||
@@ -53,10 +53,10 @@ class LicenseMapperUnitTest {
|
||||
|
||||
@Test
|
||||
void givenLicenseDtoWithEndDateInTwoWeeks_WhenMapperMethodIsInvoked_ThenLicenseShouldBePopulatedWithRenewalRequiredSetToTrue() {
|
||||
License license = licenseMapper.toLicense(LicenseDto.builder()
|
||||
.endDate(LocalDateTime.now()
|
||||
.plusDays(10))
|
||||
.build());
|
||||
LicenseDto licenseDto = new LicenseDto();
|
||||
licenseDto.setEndDate(LocalDateTime.now()
|
||||
.plusDays(10));
|
||||
License license = licenseMapper.toLicense(licenseDto);
|
||||
assertThat(license).isNotNull();
|
||||
assertThat(license.isRenewalRequired()).isTrue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user