Skip to content

Commit

Permalink
Improve assertJ tests by using containsExactlyInAnyOrder to account for
Browse files Browse the repository at this point in the history
HashSet's unordered nature.

Signed-off-by: Yusen Wang <[email protected]>
  • Loading branch information
everbrightw committed Dec 6, 2024
1 parent 924e88a commit cac5f08
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void testCreateClique() {
jtBuilder.createClique(dX1.getId(), clonedAdjMatrix, vertices, adjList );

assertThat(vertices).hasSize(3);
assertThat(vertices).containsExactly(2, 3, 4);
assertThat(vertices).containsExactlyInAnyOrder(2, 3, 4);

assertLinkedNode(jtBuilder, 1, 2, 3, 4);
assertLinkedNode(jtBuilder, 2, 1, 3, 4);
Expand Down Expand Up @@ -477,7 +477,7 @@ public void testIterativeEliminationUsingEdgeAndWeight() {
adjList = clonedAdjMatrix[ id ];
jtBuilder.createClique(4, clonedAdjMatrix, verticesToUpdate, adjList);
assertThat(verticesToUpdate).hasSize(3);
assertThat(verticesToUpdate).containsExactly(1, 2, 6); // don't forget 3 and 5 were already eliminated
assertThat(verticesToUpdate).containsExactlyInAnyOrder(1, 2, 6); // don't forget 3 and 5 were already eliminated
jtBuilder.eliminateVertex(p, elmVertMap, clonedAdjMatrix, adjList, verticesToUpdate, v );

// assert all new edges
Expand Down

0 comments on commit cac5f08

Please sign in to comment.