summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy
diff options
context:
space:
mode:
authortragait <rahul.tyagi@est.tech>2021-09-10 10:45:31 +0100
committertragait <rahul.tyagi@est.tech>2021-09-10 12:12:18 +0100
commitaea4b371e4c06a7d5b4191ab8a602e99abd1f140 (patch)
tree1ce41c5f7d82c49a613ca7f82c531c5f1fbafabc /src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy
parent7eb4d1b72e0d45ede0c67223082fcc9760be4ead (diff)
revert cps:634 postpone this bug to jakarta
This commit also have fix in application yaml for correct ncmp api path for registration url. Issue-ID: CPS-634 Issue-ID: CPS-617 Signed-off-by: tragait <rahul.tyagi@est.tech> Change-Id: I465991492a01092e28b97583f84ed959c54ffaa6
Diffstat (limited to 'src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy')
-rw-r--r--src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy
index f5c059c7..32df97b6 100644
--- a/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy
+++ b/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy
@@ -21,6 +21,7 @@
package org.onap.cps.ncmp.dmi.service.client
import org.onap.cps.ncmp.dmi.config.DmiConfiguration
+import org.springframework.http.HttpMethod
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestTemplate
import spock.lang.Specification
@@ -48,8 +49,8 @@ class NcmpRestClientSpec extends Specification {
when: 'register cm-handle with ncmp is invoked'
def result = objectUnderTest.registerCmHandlesWithNcmp(jsonData)
then: 'the rest template is called with the correct uri and json in the body'
- 1 * mockRestTemplate.postForEntity({ it.toString() == 'http://some-uri/some-url' },
- { it.body.contains(jsonData) }, String.class) >> mockResponseEntity
+ 1 * mockRestTemplate.exchange({ it.toString() == 'http://some-uri/some-url' },
+ HttpMethod.POST, { it.body.contains(jsonData) }, String.class) >> mockResponseEntity
and: 'the output of the method is equal to the output from the test template'
result == mockResponseEntity
}