-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move junit4 to assertj #5685
Move junit4 to assertj #5685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks great. The only issue is the conversation of some assert description into the Assertj as()
. I tried to eyeball them into something that makes more sense, but I was not super clear.
Here is the example from the docs:
// as() is used to describe the test and will be shown before the error message
assertThat(frodo.getAge()).as("check %s's age", frodo.getName()).isEqualTo(33);
So we should give them an additional look, with this background information.
I dedicate this PR review to @bsideup, whose effort in reviewing the last Assertj refactoring PR motivated me to go through this one file-by-file as well 😅
docs/examples/junit4/generic/src/test/java/generic/ExecTest.java
Outdated
Show resolved
Hide resolved
docs/examples/junit4/generic/src/test/java/generic/HostPortExposedTest.java
Outdated
Show resolved
Hide resolved
modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java
Outdated
Show resolved
Hide resolved
modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java
Outdated
Show resolved
Hide resolved
modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver4Test.java
Outdated
Show resolved
Hide resolved
ffmpegOutput.contains("Duration: 00:") && !(ffmpegOutput.contains("Duration: 00:00:00.00")) | ||
); | ||
assertThat(ffmpegOutput.contains("Duration: 00:") && !(ffmpegOutput.contains("Duration: 00:00:00.00"))) | ||
.as("Duration is incorrect in:\n " + ffmpegOutput) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, should contain the expected duration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would make the description more accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my suggestion below. Feel free to accept, resolve this conversation and then merge 😇
...s/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java
Outdated
Show resolved
Hide resolved
modules/trino/src/test/java/org/testcontainers/containers/TrinoContainerTest.java
Outdated
Show resolved
Hide resolved
modules/trino/src/test/java/org/testcontainers/containers/TrinoContainerTest.java
Outdated
Show resolved
Hide resolved
modules/trino/src/test/java/org/testcontainers/containers/TrinoContainerTest.java
Outdated
Show resolved
Hide resolved
…osedTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…CassandraDriver4Test.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…upiter/TestLifecycleAwareExceptionCapturingTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…stoContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…stoContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…stoContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
@@ -29,11 +29,7 @@ | |||
org.assertj.core.api.Assertions.*, | |||
org.assertj.core.api.Assumptions.*, | |||
org.awaitility.Awaitility.*, | |||
org.hamcrest.Matchers.*, | |||
org.hamcrest.MatcherAssert.*, | |||
org.junit.Assert.*, | |||
org.junit.Assume.*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should consider migrating this one to Assumptions
too btw
core/src/test/java/org/testcontainers/images/RemoteDockerImageTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/testcontainers/junit/wait/strategy/AbstractWaitStrategyTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 a few nits re automatically generated code, but excited to see these being replaced with AssertJ 🎉
…oContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…oContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…RecordingWebDriverContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…oContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
…CassandraDriver3Test.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
...s/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java
Outdated
Show resolved
Hide resolved
ffmpegOutput.contains("Duration: 00:") && !(ffmpegOutput.contains("Duration: 00:00:00.00")) | ||
); | ||
assertThat(ffmpegOutput.contains("Duration: 00:") && !(ffmpegOutput.contains("Duration: 00:00:00.00"))) | ||
.as("Duration is incorrect in:\n " + ffmpegOutput) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my suggestion below. Feel free to accept, resolve this conversation and then merge 😇
…RecordingWebDriverContainerTest.java Co-authored-by: Kevin Wittek <kiview@users.noreply.github.com>
No description provided.