diff options
author | danielhanrahan <daniel.hanrahan@est.tech> | 2024-08-16 14:15:23 +0100 |
---|---|---|
committer | danielhanrahan <daniel.hanrahan@est.tech> | 2024-08-16 14:15:23 +0100 |
commit | 337ca7b2f98c439e33cacd4b10f1227d511fe101 (patch) | |
tree | ddf18e2c79651a71fb3af82da0aa5567533ad5b6 /integration-test | |
parent | 6ce44d58e3c6a7d41d34cac02a4958fe91d7583a (diff) |
Fix intermittent test failure of Delta between anchors
Test fails sometimes due to non-deterministic order of results.
The issue is fixed by sorting the delta reports.
Issue-ID: CPS-2369
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I60fd459a482a7e3dc209ee3056794817d37f5149
Diffstat (limited to 'integration-test')
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy index b274324d71..d8395d0c91 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy @@ -459,17 +459,19 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { def 'Get delta between 2 anchors'() { when: 'attempt to get delta report between anchors' def result = objectUnderTest.getDeltaByDataspaceAndAnchors(FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_ANCHOR_3, BOOKSTORE_ANCHOR_5, '/', OMIT_DESCENDANTS) + and: 'report is ordered based on xpath' + result = result.toList().sort { it.xpath } then: 'delta report contains expected number of changes' result.size() == 3 and: 'delta report contains UPDATE action with expected xpath' assert result[0].getAction() == 'update' assert result[0].getXpath() == '/bookstore' - and: 'delta report contains REMOVE action with expected xpath' - assert result[1].getAction() == 'remove' - assert result[1].getXpath() == "/bookstore-address[@bookstore-name='Easons-1']" and: 'delta report contains ADD action with expected xpath' - assert result[2].getAction() == 'add' - assert result[2].getXpath() == "/bookstore-address[@bookstore-name='Crossword Bookstores']" + assert result[1].getAction() == 'add' + assert result[1].getXpath() == "/bookstore-address[@bookstore-name='Crossword Bookstores']" + and: 'delta report contains REMOVE action with expected xpath' + assert result[2].getAction() == 'remove' + assert result[2].getXpath() == "/bookstore-address[@bookstore-name='Easons-1']" } def 'Get delta between 2 anchors returns empty response when #scenario'() { |