Slide 20
Slide 20 text
@Test
fun `translates request`() {
assertThat(GetUser("foobar").toRequest(), equalTo(Request(GET, "/users/foobar")))
}
@Test
fun `translates response`() {
assertThat(GetUser("foobar").fromResponse(Response(OK).body("foobar/admin,mgmt")),
equalTo(UserDetails("foobar", listOf("admin", "mgmt"))))
}
testing actions