JingGe commented on a change in pull request #18014:
URL: https://github.com/apache/flink/pull/18014#discussion_r773808379
##########
File path:
flink-test-utils-parent/flink-connector-test-utils/src/main/java/org/apache/flink/connector/testutils/source/reader/SourceReaderTestBase.java
##########
@@ -207,19 +207,16 @@ public void collect(Integer element, long timestamp) {
public void validate() {
- assertEquals(
- String.format("Should be %d distinct elements in total",
totalNumRecords),
- totalNumRecords,
- consumedValues.size());
- assertEquals(
- String.format("Should be %d elements in total",
totalNumRecords),
- totalNumRecords,
- count);
- assertEquals("The min value should be 0", 0, min);
- assertEquals(
- String.format("The max value should be %d",
totalNumRecords - 1),
- totalNumRecords - 1,
- max);
+ assertThat(consumedValues)
+ .withFailMessage("Should be %d distinct elements in
total", totalNumRecords)
Review comment:
The text used in the old JUnit4 should be more like an error msg than
describing the test. It should be better to use withFailMessage(..) in this
case. @PatrickRen WDYT?
Reference:
https://junit.org/junit4/javadoc/4.8/org/junit/Assert.html#assertEquals(java.lang.String,%20long,%20long).
The message is used for AssertionError.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]