diff options
author | danielhanrahan <daniel.hanrahan@est.tech> | 2024-06-21 11:12:45 +0100 |
---|---|---|
committer | Daniel Hanrahan <daniel.hanrahan@est.tech> | 2024-06-25 12:38:47 +0000 |
commit | 7915e994ac4eb403461b3a93165a2e3c72871ab6 (patch) | |
tree | 789a2d6e89333327e7ae044073d917e7b5cf542f /integration-test | |
parent | 37d82d5d54ede4c05862fe648911c383d253cec3 (diff) |
Fix incorrect use of getAnchors(dataspace, schemasets)
There is an issue in a method deleteDataNodes(dataspace, anchors)
where it doesn't send data update events. This is because it fetches
anchors using a method getAnchors(dataspace, schemaSetNames), when it
needs to fetch anchors by name: getAnchors(dataspace, anchorNames)
Changes:
- Rename getAnchors method using schemasets to getAnchorsBySchemaSetNames
- Add a method getAnchors(dataspace, anchorNames)
- Update test of deleteDataNodes method using getAnchors so it checks
that data update events are sent
Issue-ID: CPS-2254
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I55fe853f0a9278a66a5724bf4cf2723b0e2fbc8b
Diffstat (limited to 'integration-test')
2 files changed, 4 insertions, 4 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAnchorServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAnchorServiceIntegrationSpec.groovy index 3013e6ff94..26857799a1 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAnchorServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsAnchorServiceIntegrationSpec.groovy @@ -63,9 +63,9 @@ class CpsAnchorServiceIntegrationSpec extends CpsIntegrationSpecBase { then: 'there are 3 anchors in the general test database' assert objectUnderTest.getAnchors(GENERAL_TEST_DATASPACE).size() == 3 and: 'there are 2 anchors associated with bookstore schema set' - assert objectUnderTest.getAnchors(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET).size() == 2 + assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, BOOKSTORE_SCHEMA_SET).size() == 2 and: 'there is 1 anchor associated with other schema set' - assert objectUnderTest.getAnchors(GENERAL_TEST_DATASPACE, 'otherSchemaSet').size() == 1 + assert objectUnderTest.getAnchorsBySchemaSetName(GENERAL_TEST_DATASPACE, 'otherSchemaSet').size() == 1 } def 'Querying anchor(name)s (depends on previous test!).'() { diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataspaceServiceLimitsPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataspaceServiceLimitsPerfTest.groovy index e1235272fe..ab8ffe7c76 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataspaceServiceLimitsPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/CpsDataspaceServiceLimitsPerfTest.groovy @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation + * Copyright (C) 2023-2024 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ class CpsDataspaceServiceLimitsPerfTest extends CpsPerfTestBase { given: 'more than 32,766 schema set names' def schemaSetNames = (0..40_000).collect { "size-of-this-name-does-not-matter-for-limit-" + it } when: 'single get is executed to get all the anchors' - objectUnderTest.getAnchors(CPS_PERFORMANCE_TEST_DATASPACE, schemaSetNames) + objectUnderTest.getAnchorsBySchemaSetNames(CPS_PERFORMANCE_TEST_DATASPACE, schemaSetNames) then: 'a database exception is not thrown' noExceptionThrown() } |