private fun assertStatus(ctx: TestContext, status: Int): Handler { val async = ctx.async() return asHandler { resp: HttpClientResponse -> when(resp.statusCode()) { status -> async.complete() else -> ctx.fail("Expecting Bad Request (400), status code is ${resp.statusCode()}") } } }