Skip to content

Commit 4a97fc3

Browse files
committed
Ignore the order of values when comparing the results of a distinct command in tests
1 parent 4232672 commit 4a97fc3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

driver/src/test/functional/com/mongodb/DBCollectionFunctionalSpecification.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import spock.lang.Unroll
3333
import static com.mongodb.ClusterFixture.isDiscoverableReplicaSet
3434
import static com.mongodb.ClusterFixture.serverVersionAtLeast
3535
import static org.hamcrest.Matchers.contains
36+
import static org.hamcrest.Matchers.containsInAnyOrder
3637
import static spock.util.matcher.HamcrestSupport.that
3738

3839
@SuppressWarnings('DuplicateMapLiteral')
@@ -348,7 +349,7 @@ class DBCollectionFunctionalSpecification extends FunctionalSpecification {
348349

349350
then:
350351
distinctValues.size() == 5
351-
that distinctValues, contains(null, 'a', 1, ~['b': 'c'], ~['list': [2, 'd', ~['e': 3]]])
352+
that distinctValues, containsInAnyOrder(null, 'a', 1, ~['b': 'c'], ~['list': [2, 'd', ~['e': 3]]])
352353
}
353354

354355
@SuppressWarnings('UnnecessaryObjectReferences')

0 commit comments

Comments
 (0)