summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service
diff options
context:
space:
mode:
authorJoseph Keenan <joseph.keenan@est.tech>2022-08-02 12:47:52 +0000
committerGerrit Code Review <gerrit@onap.org>2022-08-02 12:47:52 +0000
commite79e48d75c0a84e7f1b3cef53d29ac89321184ea (patch)
tree32e411fae9bfc8cf658c7162de9a70995fbcb0ad /cps-ncmp-service
parent7a75eea4e388a04d8b67610ef53ed16db75489e6 (diff)
parent0b57f077accd7cf7fa58a8cf69f3e4111f805822 (diff)
Merge "Incorrect response to {} for cmhandle id-searches"
Diffstat (limited to 'cps-ncmp-service')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java4
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceSpec.groovy2
2 files changed, 3 insertions, 3 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java
index d784bcdeac..6696f8e5ad 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceImpl.java
@@ -217,7 +217,9 @@ public class NetworkCmProxyCmHandlerQueryServiceImpl implements NetworkCmProxyCm
}
private Set<String> getAllCmHandleIds() {
- return inventoryPersistence.getAnchors().parallelStream().map(Anchor::getName).collect(Collectors.toSet());
+ return inventoryPersistence.getDataNode("/dmi-registry")
+ .getChildDataNodes().stream().map(dataNode -> dataNode.getLeaves().get("id").toString())
+ .collect(Collectors.toSet());
}
private NcmpServiceCmHandle createNcmpServiceCmHandle(final DataNode dataNode) {
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceSpec.groovy
index 40ec12da87..19c5049021 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceSpec.groovy
@@ -156,8 +156,6 @@ class NetworkCmProxyCmHandlerQueryServiceSpec extends Specification {
def cmHandleQueryParameters = new CmHandleQueryServiceParameters()
and: 'the inventory persistence returns the dmi registry datanode'
inventoryPersistence.getDataNode("/dmi-registry") >> dmiRegistry
- and: 'the inventory persistence returns anchors for get anchors'
- inventoryPersistence.getAnchors() >> [new Anchor(name: 'PNFDemo1'), new Anchor(name: 'PNFDemo2'), new Anchor(name: 'PNFDemo3'), new Anchor(name: 'PNFDemo4')]
when: 'the query is executed for both cm handle ids and details'
def returnedCmHandlesJustIds = objectUnderTest.queryCmHandleIds(cmHandleQueryParameters)
def returnedCmHandlesWithData = objectUnderTest.queryCmHandles(cmHandleQueryParameters)