Skip to content

Instantly share code, notes, and snippets.

Last active Dec 28, 2017
What would you like to do?
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class DslDemoApplicationTests {
private lateinit var testRestTemplate: TestRestTemplate
fun `Test 'Hello' endpoint using a valid name`() {
val headers = HttpHeaders()
headers.put("Accept", listOf("application/json"))
val entity = HttpEntity<Any>(headers)
val response =
"/api/hello/Jarno", HttpMethod.GET, entity,
assertEquals(HttpStatus.OK, response.statusCode)
assertJsonEquals("{ \"message\": \"Hi, Jarno!\" }", response.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment