mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 10:41:06 +01:00
Do not use Optional for modification date
First, Optionals should not be used for fields, second this does not provide any benefits
This commit is contained in:
@@ -8,7 +8,6 @@ import org.mockito.Mock;
|
||||
import sonia.scm.user.User;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -47,7 +46,7 @@ public class UserDtoToUserMapperTest {
|
||||
UserDto dto = new UserDto();
|
||||
dto.setName("abc");
|
||||
dto.setCreationDate(Instant.now());
|
||||
dto.setLastModified(Optional.empty());
|
||||
dto.setLastModified(null);
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +122,6 @@ public class UserToUserDtoMapperTest {
|
||||
UserDto userDto = mapper.map(user);
|
||||
|
||||
assertEquals(expectedCreationDate, userDto.getCreationDate());
|
||||
assertEquals(expectedModificationDate, userDto.getLastModified().get());
|
||||
assertEquals(expectedModificationDate, userDto.getLastModified());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user