Skip to content

Commit 891f0ba

Browse files
pivovaritKevinGilmore
authored andcommitted
Assertj refactor (eugenp#1635)
1 parent 9108267 commit 891f0ba

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎libraries/src/test/java/com/baeldung/flink/WordCountIntegrationTest.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
public class WordCountIntegrationTest {
25-
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
25+
private final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
2626

2727
@Test
2828
public void givenDataSet_whenExecuteWordCount_thenReturnWordCount() throws Exception {
@@ -65,8 +65,8 @@ public void givenDataSetOfComplexObjects_whenMapToGetOneField_thenReturnedListHa
6565
List<Integer> ages = personDataSource.map(p -> p.age).collect();
6666

6767
//then
68-
assertThat(ages.size()).isEqualTo(2);
69-
assertThat(ages.containsAll(Arrays.asList(23, 75))).isTrue();
68+
assertThat(ages).hasSize(2);
69+
assertThat(ages).contains(23, 75);
7070

7171
}
7272

@@ -110,8 +110,8 @@ public void giveTwoDataSets_whenJoinUsingId_thenProduceJoinedData() throws Excep
110110
.collect();
111111

112112
//then
113-
assertThat(joined.size()).isEqualTo(1);
114-
assertThat(joined.contains(new Tuple2<>(firstTransaction, address)));
113+
assertThat(joined).hasSize(1);
114+
assertThat(joined).contains(new Tuple2<>(firstTransaction, address));
115115

116116
}
117117

0 commit comments

Comments
 (0)