- mockRestTemplate.exchange(getResourceDataUrl, HttpMethod.PUT, _ as HttpEntity, Object.class) >> mockResponseEntity
- when: 'PUT operation is invoked'
- def result = objectUnderTest.putOperationWithJsonData(getResourceDataUrl, 'json-data', new HttpHeaders())
- then: 'the output of the method is equal to the output from the test template'
- result == mockResponseEntity
- }
-
- def 'DMI POST operation.'() {
- given: 'a POST url'
- def getResourceDataUrl = 'http://some-uri/createResourceDataUrl'
- and: 'the rest template returns a valid response entity'
- def mockResponseEntity = Mock(ResponseEntity)
- mockRestTemplate.postForEntity(getResourceDataUrl, _ as HttpEntity, String.class) >> mockResponseEntity