Skip to content
Discussion options

You must be logged in to vote

I've asked this question on Zulip because I'm affected by a similar situation (combining Panache access and RestAssured in the same test).

@mkouba pointed out that io.quarkus.vertx.VertxContextSupport.subscribeAndAwait(Supplier<Uni<T>>) can be used in a blocking thread to run a non-blocking piece of code with a Vertx context.

So I think that your test could be rewritten as:

@Test
void testCreatePilotShouldReturn201() {
  var dto = CreatePilotDTO.builder()
    .email("[email protected]")
    .lastName("Doe").firstName("John")
    .build();

  RestAssured.given()
    .contentType(ContentType.JSON)
    .body(dto)
    .put("/api/v1/users/pilots")
    .then()
    .statusCode(201);
  assertTrue(Ver…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@IceDevelop74
Comment options

@mkouba
Comment options

mkouba May 11, 2023
Collaborator

Answer selected by IceDevelop74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants