Created
October 7, 2022 13:07
-
-
Save s1monw1/0eae978ac225e6712a71f0c53c1e0af3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val addExtraHeaderFilter = Filter { next -> | |
{ | |
next(it).header("x-extra-header", "some value") | |
} | |
} | |
@Test | |
fun adds_a_special_header() { | |
val handler: HttpHandler = addExtraHeaderFilter.then { Response(OK) } | |
val response: Response = handler(Request(GET, "/echo")) | |
assertThat(response, hasStatus(OK) | |
.and(hasHeader("x-extra-header", "some value"))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment