summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/test/groovy/org
diff options
context:
space:
mode:
authorkissand <andras.zoltan.kiss@est.tech>2022-06-15 13:48:07 +0200
committerkissand <andras.zoltan.kiss@est.tech>2022-06-17 11:11:14 +0200
commit3b1d84ac048bd057a5497a2d0243cba675980781 (patch)
treeb79e1f6cfab3da9d7b7ba6f4cc79ee6f70781c59 /cps-ncmp-service/src/test/groovy/org
parent44d933db05217eac411eec4972a0d7c880cf5c4e (diff)
Quick fix for performance degradation bug
Issue-ID: CPS-1085 Change-Id: I15715ef37909d4e2fe2f1f80e621a21c8037fbd0 Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/test/groovy/org')
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyCmHandlerQueryServiceSpec.groovy10
1 files changed, 5 insertions, 5 deletions
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 b689097cc4..46c866282a 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
@@ -54,7 +54,7 @@ class NetworkCmProxyCmHandlerQueryServiceSpec extends Specification {
when: 'the service is invoked'
def returnedCmHandles = objectUnderTest.queryCmHandles(cmHandleQueryParameters)
then: 'the correct expected cm handles are returned'
- returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toList()) == expectedCmHandleIds
+ returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toSet()) == expectedCmHandleIds as Set
where: 'the following data is used'
scenario | publicProperties || expectedCmHandleIds
'single matching property' | [['Contact' : 'newemailforstore@bookstore.com']] || ['PNFDemo', 'PNFDemo2', 'PNFDemo4']
@@ -75,10 +75,10 @@ class NetworkCmProxyCmHandlerQueryServiceSpec extends Specification {
when: 'the service is invoked'
def returnedCmHandles = objectUnderTest.queryCmHandles(cmHandleQueryParameters)
then: 'the correct expected cm handles are returned'
- returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toList()) == expectedCmHandleIds
+ returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toSet()) == expectedCmHandleIds as Set
where: 'the following data is used'
scenario | moduleNames || expectedCmHandleIds
- 'single matching module name' | [['moduleName' : 'MODULE-NAME-001']] || ['PNFDemo2', 'PNFDemo3', 'PNFDemo']
+ 'single matching module name' | [['moduleName' : 'MODULE-NAME-001']] || ['PNFDemo3', 'PNFDemo', 'PNFDemo2']
'module name dont match' | [['moduleName' : 'MODULE-NAME-004']] || []
'2 module names, only one match (and)' | [['moduleName' : 'MODULE-NAME-002'], ['moduleName': 'MODULE-NAME-003']] || ['PNFDemo4']
'2 module names, no match (and)' | [['moduleName' : 'MODULE-NAME-002'], ['moduleName': 'MODULE-NAME-004']] || []
@@ -99,7 +99,7 @@ class NetworkCmProxyCmHandlerQueryServiceSpec extends Specification {
when: 'the service is invoked'
def returnedCmHandles = objectUnderTest.queryCmHandles(cmHandleQueryParameters)
then: 'the correct expected cm handles are returned'
- returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toList()) == expectedCmHandleIds
+ returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toSet()) == expectedCmHandleIds as Set
where: 'the following data is used'
scenario | moduleNames | publicProperties || expectedCmHandleIds
'particularly intersect' | [['moduleName' : 'MODULE-NAME-001']] | [['Contact' : 'newemailforstore@bookstore.com']] || ['PNFDemo2', 'PNFDemo']
@@ -114,7 +114,7 @@ class NetworkCmProxyCmHandlerQueryServiceSpec extends Specification {
def cmHandleQueryParameters = new CmHandleQueryServiceParameters()
def returnedCmHandles = objectUnderTest.queryCmHandles(cmHandleQueryParameters)
then: 'the correct expected cm handles are returned'
- returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toList()) == ['PNFDemo', 'PNFDemo2', 'PNFDemo3', 'PNFDemo4']
+ returnedCmHandles.stream().map(d -> d.leaves.get('id').toString()).collect(Collectors.toSet()) == ['PNFDemo', 'PNFDemo2', 'PNFDemo3', 'PNFDemo4'] as Set
}
void mockResponses() {