RocMarshal commented on code in PR #27665:
URL: https://github.com/apache/flink/pull/27665#discussion_r2922810472
##########
flink-tests/src/test/java/org/apache/flink/test/checkpointing/ContinuousFileProcessingCheckpointITCase.java:
##########
@@ -136,10 +135,10 @@ public void postSubmit() throws Exception {
fc.join();
Map<Integer, Set<String>> collected = actualCollectedContent;
- Assert.assertEquals(collected.size(), fc.getFileContent().size());
+ assertThat(fc.getFileContent()).hasSize(collected.size());
Review Comment:
```suggestion
assertThat(fc.getFileContent()).hasSameSizeAs(collected);
```
##########
flink-tests/src/test/java/org/apache/flink/test/checkpointing/ContinuousFileProcessingCheckpointITCase.java:
##########
@@ -193,7 +192,8 @@ private static class TestingSinkFunction extends
RichSinkFunction<String>
@Override
public void open(OpenContext openContext) throws Exception {
// this sink can only work with DOP 1
- assertEquals(1,
getRuntimeContext().getTaskInfo().getNumberOfParallelSubtasks());
+
assertThat(getRuntimeContext().getTaskInfo().getNumberOfParallelSubtasks())
+ .isEqualTo(1);
Review Comment:
```suggestion
assertThat(getRuntimeContext().getTaskInfo().getNumberOfParallelSubtasks()).isOne();
```
##########
flink-tests/src/test/java/org/apache/flink/test/checkpointing/StateCheckpointedITCase.java:
##########
@@ -71,7 +69,7 @@ public class StateCheckpointedITCase extends
StreamFaultToleranceTestBase {
*/
@Override
public void testProgram(StreamExecutionEnvironment env) {
- assertTrue("Broken test setup", NUM_STRINGS % 40 == 0);
+ assertThat(NUM_STRINGS % 40).as("Broken test setup").isEqualTo(0);
Review Comment:
```suggestion
assertThat(NUM_STRINGS % 40).as("Broken test setup").isZero();
```
##########
flink-tests/src/test/java/org/apache/flink/test/checkpointing/UdfStreamOperatorCheckpointingITCase.java:
##########
@@ -94,7 +93,9 @@ public void postSubmit() {
// Checking the result of the built-in aggregate
for (int i = 0; i < PARALLELISM; i++) {
for (Long value : MinEvictingQueueSink.queues[i]) {
- Assert.assertTrue("Value different from 1 found, was " + value
+ ".", value == 1);
+ assertThat(value)
+ .as("Value different from 1 found, was " + value + ".")
+ .isEqualTo(1);
Review Comment:
```suggestion
assertThat(value).as("Value different from 1 found, was " +
value + ".").isOne();
```
##########
flink-tests/src/test/java/org/apache/flink/test/checkpointing/ContinuousFileProcessingCheckpointITCase.java:
##########
@@ -155,7 +154,7 @@ public int compare(String o1, String o2) {
for (String line : cntnt) {
cntntStr.append(line);
}
- Assert.assertEquals(fc.getFileContent().get(fileIdx),
cntntStr.toString());
+
assertThat(cntntStr.toString()).isEqualTo(fc.getFileContent().get(fileIdx));
Review Comment:
```suggestion
assertThat(cntntStr).hasToString(fc.getFileContent().get(fileIdx));
```
--
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]