diff options
author | danielhanrahan <daniel.hanrahan@est.tech> | 2024-04-26 10:09:54 +0100 |
---|---|---|
committer | danielhanrahan <daniel.hanrahan@est.tech> | 2024-04-26 10:48:29 +0100 |
commit | 2830723b8c5d5bb40c171c88f055adbc1a808f68 (patch) | |
tree | dd32cb1b04c1724614c9f3f7bdc683a1be09e803 /cps-service/src/test/groovy | |
parent | 2b979f63a4020b65a2a85ecdb2bfa2b970eb9f76 (diff) |
Faster module searches (CPS-2190 #3)
This greatly improves performance of module searches by eliminating
unneeded SQL queries via Hibernate lazy fetching.
Issue-ID: CPS-2190
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: Ie9e65017d0027366456f1741cc37b10679317b25
Diffstat (limited to 'cps-service/src/test/groovy')
-rw-r--r-- | cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAnchorServiceImplSpec.groovy | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAnchorServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAnchorServiceImplSpec.groovy index 3546b81671..c7865386bc 100644 --- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAnchorServiceImplSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsAnchorServiceImplSpec.groovy @@ -118,7 +118,7 @@ class CpsAnchorServiceImplSpec extends Specification { def 'Query all anchor identifiers for a dataspace and module names.'() { given: 'the persistence service is invoked with the expected parameters and returns a list of anchors' - mockCpsAdminPersistenceService.queryAnchors('some-dataspace-name', ['some-module-name']) >> [new Anchor(name:'some-anchor-identifier')] + mockCpsAdminPersistenceService.queryAnchorNames('some-dataspace-name', ['some-module-name']) >> ['some-anchor-identifier'] when: 'query anchor names is called using a dataspace name and module name' def result = objectUnderTest.queryAnchorNames('some-dataspace-name', ['some-module-name']) then: 'get anchor identifiers returns the same anchor identifier returned by the persistence layer' @@ -130,7 +130,7 @@ class CpsAnchorServiceImplSpec extends Specification { def 'Query all anchors with Module Names Not Found Exception in persistence layer.'() { given: 'the persistence layer throws a Module Names Not Found Exception' def originalException = new ModuleNamesNotFoundException('exception-ds', ['m1', 'm2']) - mockCpsAdminPersistenceService.queryAnchors(*_) >> { throw originalException} + mockCpsAdminPersistenceService.queryAnchorNames(*_) >> { throw originalException} when: 'attempt query anchors' objectUnderTest.queryAnchorNames('some-dataspace-name', []) then: 'the same exception is thrown (up)' |