summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation
diff options
context:
space:
mode:
authortragait <rahul.tyagi@est.tech>2021-08-06 17:01:31 +0100
committertragait <rahul.tyagi@est.tech>2021-08-17 13:55:12 +0100
commite398be5923a47650b109512c795244cdc2b5eb10 (patch)
tree4d12aa2f7d18785825f4c5b1e9073a68505cf30b /src/test/groovy/org/onap/cps/ncmp/dmi/service/operation
parent3139ece993c68ce7e40d166acdd5d9572a3a8a1e (diff)
implement passthough operational for dmi
Issue-ID: CPS-486 Signed-off-by: tragait <rahul.tyagi@est.tech> Change-Id: Icf48fa93ea1f0d8a27d2e7e1ab0cfd6096a765ec
Diffstat (limited to 'src/test/groovy/org/onap/cps/ncmp/dmi/service/operation')
-rw-r--r--src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy
index 9b07d68e..8a415c82 100644
--- a/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy
+++ b/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy
@@ -25,6 +25,7 @@ import org.onap.cps.ncmp.dmi.service.client.SdncRestconfClient
import org.spockframework.spring.SpringBean
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.http.HttpHeaders
import org.springframework.test.context.ContextConfiguration
import spock.lang.Specification
@@ -34,6 +35,7 @@ class SdncOperationsSpec extends Specification {
@SpringBean
SdncRestconfClient mockSdncRestClient = Mock()
+
@Autowired
SdncOperations objectUnderTest
@@ -56,4 +58,13 @@ class SdncOperationsSpec extends Specification {
then: 'the SDNC Rest client is invoked with the correct URL and json data'
1 * mockSdncRestClient.postOperationWithJsonData(expectedUrl, 'some-json-data')
}
-}
+
+ def 'Get resource data from node to SDNC.'() {
+ given: 'excpected url, topology-id, sdncOperation object'
+ def expectedUrl = '/rests/data/network-topology:network-topology/topology=test-topology/node=node1/yang-ext:mount/testResourceId?fields=testFields&depth=10&content=all'
+ when: 'called get modules from node'
+ objectUnderTest.getResouceDataForOperational('node1', 'testResourceId', 'testFields', 10,'testAcceptParam')
+ then: 'the get operation is executed with the correct URL'
+ 1 * mockSdncRestClient.getOperation(expectedUrl, _ as HttpHeaders)
+ }
+} \ No newline at end of file