Skip to content

Commit

Permalink
fix: fixed failing feature tests (#61) (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik authored Nov 27, 2023
1 parent 5a07076 commit 74578e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/test/java/com/epam/aidial/core/FeaturesApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ void testUpstreamEndpoint(Vertx vertx, VertxTestContext context, String inboundP
req.response().setStatusCode(500).end("ERROR");
}
})
.listen();
.listen().onSuccess(server ->
checkResponse(vertx, context, inboundPath, okResponse));
}

void checkResponse(Vertx vertx, VertxTestContext context, String inboundPath, String expectedResponse) {
WebClient client = WebClient.create(vertx);
client.post(serverPort, "localhost", inboundPath)
.putHeader("Api-key", "proxyKey2")
Expand All @@ -111,7 +114,7 @@ void testUpstreamEndpoint(Vertx vertx, VertxTestContext context, String inboundP
.send(context.succeeding(response -> {
context.verify(() -> {
assertEquals(200, response.statusCode());
assertEquals(okResponse, response.body());
assertEquals(expectedResponse, response.body());
context.completeNow();
});
}));
Expand Down

0 comments on commit 74578e3

Please sign in to comment.