Skip to content

Commit

Permalink
use Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
querwurzel committed Dec 13, 2024
1 parent 1722de9 commit ed65482
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void trackPasteLastViewed() {
newPaste.trackView(today);
newPaste.trackView(yesterday);

assertThat(newPaste.getLastViewed().get()).isEqualTo(today);
assertThat(newPaste.getLastViewed()).hasValue(today);
assertThat(newPaste.getViews()).isEqualTo(2);
}

Expand All @@ -84,7 +84,7 @@ void markAsExpired(LocalDateTime dateOfExpiry, boolean exceptionExpected) {

if (exceptionExpected) {
assertThrows(IllegalStateException.class, paste::markAsExpired);
assertThat(paste.getDateOfExpiry().get()).isEqualTo(dateOfExpiry);
assertThat(paste.getDateOfExpiry()).hasValue(dateOfExpiry);
} else {
paste.markAsExpired();

Expand Down

0 comments on commit ed65482

Please sign in to comment.