use of io.vertx.ext.web.validation.testutils.TestRequest in project vertx-web by vert-x3.
the class RouterBuilderSecurityHandlerOptionalTest method mountSingle.
@Test
public void mountSingle(Vertx vertx, VertxTestContext testContext) {
Checkpoint checkpoint = testContext.checkpoint();
loadBuilderAndStartServer(vertx, SECURITY_TESTS, testContext, routerBuilder -> {
routerBuilder.setOptions(FACTORY_OPTIONS);
routerBuilder.securityHandler("api_key", SimpleAuthenticationHandler.create().authenticate(ctx -> Future.failedFuture(new HttpException(401, "Oops!")))).operation("pets").handler(routingContext -> routingContext.response().setStatusCode(200).end());
}).onComplete(h -> testRequest(client, HttpMethod.GET, "/pets").expect(statusCode(200), statusMessage("OK")).send(testContext, checkpoint));
}
Aggregations