This is an automated email from the ASF dual-hosted git repository.

mariofusco pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git


The following commit(s) were added to refs/heads/main by this push:
     new a586bb4210 Improve assertJ tests by using containsExactlyInAnyOrder to 
account for (#6187)
a586bb4210 is described below

commit a586bb421087d9e4796ffd8e59875c486c7d7ecb
Author: Yusen Wang <[email protected]>
AuthorDate: Tue Dec 10 03:25:04 2024 -0600

    Improve assertJ tests by using containsExactlyInAnyOrder to account for 
(#6187)
    
    HashSet's unordered nature.
    
    Signed-off-by: Yusen Wang <[email protected]>
---
 .../test/java/org/drools/beliefs/bayes/JunctionTreeBuilderTest.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/drools-beliefs/src/test/java/org/drools/beliefs/bayes/JunctionTreeBuilderTest.java
 
b/drools-beliefs/src/test/java/org/drools/beliefs/bayes/JunctionTreeBuilderTest.java
index a284033836..cc603e4c21 100644
--- 
a/drools-beliefs/src/test/java/org/drools/beliefs/bayes/JunctionTreeBuilderTest.java
+++ 
b/drools-beliefs/src/test/java/org/drools/beliefs/bayes/JunctionTreeBuilderTest.java
@@ -187,7 +187,7 @@ public class JunctionTreeBuilderTest {
         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);
@@ -477,7 +477,7 @@ public class JunctionTreeBuilderTest {
         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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to