From b0d930752fd6be436061226c7395038f6828438e Mon Sep 17 00:00:00 2001 From: niamhcore Date: Thu, 28 Oct 2021 13:39:24 +0100 Subject: Add get cm handles by modules names - service layer Issue-ID: CPS-644 Signed-off-by: niamhcore Change-Id: Ic2a57df02d533a0066382c12c35be8d524b6cdad --- .../org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java | 2 +- .../onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'cps-ri/src') diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java index 2b63169d4..cd3c30b97 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java @@ -94,7 +94,7 @@ public class CpsAdminPersistenceServiceImpl implements CpsAdminPersistenceServic } @Override - public Collection getAnchors(final String dataspaceName, final Collection inputModuleNames) { + public Collection queryAnchors(final String dataspaceName, final Collection inputModuleNames) { validateDataspaceAndModuleNames(dataspaceName, inputModuleNames); final Collection anchorEntities = anchorRepository.getAnchorsByDataspaceNameAndModuleNames(dataspaceName, inputModuleNames); diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy index c37651089..af199be03 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsAdminPersistenceServiceSpec.groovy @@ -144,9 +144,9 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { } @Sql([CLEAR_DATA, SAMPLE_DATA_FOR_ANCHORS_WITH_MODULES]) - def 'Get anchors that have #scenario.'() { + def 'Query anchors that have #scenario.'() { when: 'all anchor are retrieved for the given dataspace name and module names' - def anchors = objectUnderTest.getAnchors('DATASPACE-001', inputModuleNames) + def anchors = objectUnderTest.queryAnchors('DATASPACE-001', inputModuleNames) then: 'the expected anchors are returned' anchors.size() == expectedAnchors.size() anchors.containsAll(expectedAnchors) @@ -159,9 +159,9 @@ class CpsAdminPersistenceServiceSpec extends CpsPersistenceSpecBase { } @Sql([CLEAR_DATA, SAMPLE_DATA_FOR_ANCHORS_WITH_MODULES]) - def 'Get all anchors for an #scenario.'() { - when: 'attempt to get anchors' - objectUnderTest.getAnchors(dataspaceName, moduleNames) + def 'Query all anchors for an #scenario.'() { + when: 'attempt to query anchors' + objectUnderTest.queryAnchors(dataspaceName, moduleNames) then: 'the correct exception is thrown with the relevant details' def thrownException = thrown(expectedException) thrownException.details.contains(expectedMessageDetails) -- cgit 1.2.3-korg