Skip to content

Commit

Permalink
test: GoTimeUtilTest asserts optional with assertj
Browse files Browse the repository at this point in the history
Update GoTimeUtilTest.java

 GoTimeUtilTest is refactored to not directly call Optional.get().
---
Merge pull request #1 from kushagrasinha123ks/kushagra/issue#2970

Update GoTimeUtilTest.java
---
Revert "Update GoTimeUtilTest.java"
---
Merge pull request #2 from kushagrasinha123ks/revert-1-kushagra/issue#2970

Revert "Update GoTimeUtilTest.java"
---
Update GoTimeUtilTest.java

GoTimeUtilTest is refactored to not directly call Optional.get().
---
Update GoTimeUtilTest.java

inlined the method calls in conversion function
---
Update GoTimeUtilTest.java

removed the unused imports.
  • Loading branch information
kushagrasinha123ks authored Apr 30, 2024
1 parent 1fd72cd commit 6a3e71c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class GoTimeUtilTest {
@ParameterizedTest(name = "duration ''{0}'' should be ''{1}'' seconds")
@MethodSource("data")
void conversion(String duration, int expectedDuration) {
int result = GoTimeUtil.durationSeconds(duration).get();
assertThat(result).isEqualTo(expectedDuration);
assertThat(GoTimeUtil.durationSeconds(duration)).isPresent().contains(expectedDuration);
}

static Stream<Arguments> data() {
Expand Down

0 comments on commit 6a3e71c

Please sign in to comment.