summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org
diff options
context:
space:
mode:
authorNiamh Core <niamh.core@est.tech>2021-08-30 14:24:33 +0000
committerGerrit Code Review <gerrit@onap.org>2021-08-30 14:24:33 +0000
commit73d38f489970c344a859863f728cf93bc198aff7 (patch)
tree9b68be8d3634230327df5900ce60a0eac1f3c259 /src/test/groovy/org
parent776c1451ddb2eb676520f8d34103b9c889a4ea26 (diff)
parent11e9f72aa953516053d867e09a0e95c77d7d1a88 (diff)
Merge "fix getforentity in onap DMI plugin"
Diffstat (limited to 'src/test/groovy/org')
-rw-r--r--src/test/groovy/org/onap/cps/ncmp/dmi/service/client/SdncRestconfClientSpec.groovy7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/SdncRestconfClientSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/SdncRestconfClientSpec.groovy
index 9a7ed180..b550480d 100644
--- a/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/SdncRestconfClientSpec.groovy
+++ b/src/test/groovy/org/onap/cps/ncmp/dmi/service/client/SdncRestconfClientSpec.groovy
@@ -23,6 +23,7 @@ package org.onap.cps.ncmp.dmi.service.client
import org.onap.cps.ncmp.dmi.config.DmiConfiguration
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
+import org.springframework.http.HttpMethod
import org.springframework.http.ResponseEntity
import org.springframework.web.client.RestTemplate
import spock.lang.Specification
@@ -40,7 +41,8 @@ class SdncRestconfClientSpec extends Specification {
setupTestConfigurationData()
and: 'the rest template returns a valid response entity'
def mockResponseEntity = Mock(ResponseEntity)
- mockRestTemplate.getForEntity({ it.toString() == 'http://some-uri/getResourceUrl' }, String.class, _ as HttpEntity) >> mockResponseEntity
+ mockRestTemplate.exchange({ it.toString() == 'http://some-uri/getResourceUrl' },
+ HttpMethod.GET, _ as HttpEntity, String.class) >> mockResponseEntity
when: 'GET operation is invoked'
def result = objectUnderTest.getOperation(getResourceUrl)
then: 'the output of the method is equal to the output from the test template'
@@ -72,7 +74,8 @@ class SdncRestconfClientSpec extends Specification {
setupTestConfigurationData()
and: 'the rest template returns a valid response entity'
def mockResponseEntity = Mock(ResponseEntity)
- mockRestTemplate.getForEntity({ it.toString() == 'http://some-uri/getResourceUrl' }, String.class, _ as HttpEntity) >> mockResponseEntity
+ mockRestTemplate.exchange({ it.toString() == 'http://some-uri/getResourceUrl' },
+ HttpMethod.GET, _ as HttpEntity, String.class) >> mockResponseEntity
when: 'GET operation is invoked'
def result = objectUnderTest.getOperation(getResourceUrl, new HttpHeaders())
then: 'the output of the method is equal to the output from the test template'