Fix ordering issue in QueryServiceIntegrationSpec 03/138603/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Tue, 30 Jul 2024 13:38:14 +0000 (14:38 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Tue, 30 Jul 2024 13:41:36 +0000 (14:41 +0100)
A test intermittently fails due to comparing unordered list.
Fix is to compare as a set.

Issue-ID: CPS-2337
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I84bc4f7d9ff01ca7b36ecb56835387dbea6b24d1

integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy

index fd9aa54..69598a0 100644 (file)
@@ -383,7 +383,7 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase {
             def result = objectUnderTest.queryDataNodesAcrossAnchors(FUNCTIONAL_TEST_DATASPACE_1, '/bookstore', OMIT_DESCENDANTS, new PaginationOption(pageIndex, pageSize))
         then: 'correct bookstore names are queried'
             def bookstoreNames = result.collect { it.getLeaves().get('bookstore-name') }
-            assert bookstoreNames.toList() == expectedBookstoreNames
+            assert bookstoreNames.toSet() == expectedBookstoreNames.toSet()
         and: 'the correct number of page size is returned'
             assert result.size() == expectedPageSize
         and: 'the queried nodes have expected anchor names'