- def 'DMI PUT operation.'() {
- given: 'a PUT url'
- def getResourceDataUrl = 'http://some-uri/getResourceDataUrl'
- and: 'dmi properties'
- setupTestConfigurationData()
- and: 'the rest template returns a valid response entity'
- def mockResponseEntity = Mock(ResponseEntity)
- 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
- }