Skip to content

Instantly share code, notes, and snippets.

@jwalgemoed jwalgemoed/verify.kt Secret
Last active Dec 28, 2017

Embed
What would you like to do?
fun verify(testRestTemplate: TestRestTemplate) {
val entity = if (request.body != null) {
HttpEntity(request.body, request.headers)
} else {
HttpEntity(request.headers)
}
val actualResponse = testRestTemplate.exchange(request.path, request.method, entity, String::class.java)
Assert.assertEquals("Actual HTTP response code doesn't match expected value.", response.status, actualResponse.statusCode)
assertJsonEquals(response.body, actualResponse.body)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.