summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/NcmpRestClientSpec.groovy
diff options
context:
space:
mode:
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
}