We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm not getting a failure when testing this code and I don't understand where I'm doing something bad. Hopefully you can help :)
@ExtendWith(VertxExtension.class) class VertxTest { private final Logger logger = LogManager.getLogger(this.getClass()); @BeforeEach void deployVertice(Vertx vertx, VertxTestContext testContext) { vertx.deployVerticle(new FakeVertice(), testContext.succeeding(id -> { logger.info(" -> test webhook verticle deployed {}", id); logger.info("deployVertice {}", vertx.deploymentIDs()); })); } @Test void testDeployVertice(Vertx vertx, VertxTestContext testContext) { testContext.verify(() -> { logger.info("testDeployVertice {}", vertx.deploymentIDs()); assertFalse(vertx.deploymentIDs().isEmpty()); testContext.completeNow(); }); } @Test void testPostValidate(Vertx vertx, VertxTestContext testContext) { // Create the WebClient to connect to our Vertx instance WebClient webClient = WebClient.create(vertx, new WebClientOptions() .setDefaultHost("localhost") .setDefaultPort(8080)); HttpRequest<Buffer> request = webClient.get("/"); request.send(testContext.succeeding(result -> testContext.verify(() -> { logger.fatal("CODE {}", result.statusCode()); assertEquals(200, result.statusCode()); logger.fatal("JSON {}", result.bodyAsString()); logger.fatal("MESSAGE {}", result.bodyAsJsonObject().getString("message")); logger.fatal("JSON {}", result.bodyAsString()); }))); } static class FakeVertice extends AbstractVerticle { @Override public void start(Future<Void> futureVertx) { Router router = Router.router(vertx); router.route(HttpMethod.GET, "/") .handler(routingContext -> { // Write to the response and end it HttpServerResponse response = routingContext.response(); response.setStatusCode(400); String json = new JsonObject().put("message", "Vert.x is running!").encodePrettily(); response.putHeader("content-type", "application/json"); response.putHeader("content-length", "" + json.length()); response.write(json).end(); }); vertx.createHttpServer().requestHandler(router::accept) .listen(8080, ar -> { if (ar.succeeded()) { futureVertx.complete(); } if (ar.failed()) { futureVertx.fail("Can not start"); } }); } } }
The test is passing and the log is:
19:06:13,351 INFO [f.b.w.VertxTest] -> test webhook verticle deployed 8e0df37a-78ac-4c8c-9692-be50cb81c3e2 19:06:13,353 INFO [f.b.w.VertxTest] deployVertice [8e0df37a-78ac-4c8c-9692-be50cb81c3e2] 19:06:13,803 FATAL [f.b.w.VertxTest] CODE 400
Any idea?
The text was updated successfully, but these errors were encountered:
Let me check :-)
Sorry, something went wrong.
I confirm there is a bug. I'm working on a fix now.
Doing some checks on a simpler reproducer, but it looks like an exception is being swallowed somewhere.
The problem is related to the changes introduced in #5, and that have inherent correctness issues.
jponge
No branches or pull requests
I'm not getting a failure when testing this code and I don't understand where I'm doing something bad.
Hopefully you can help :)
The test is passing and the log is:
Any idea?
The text was updated successfully, but these errors were encountered: