Skip to content

Commit

Permalink
Fix OpenApi tests due to quarkusio/quarkus/pull/19148
Browse files Browse the repository at this point in the history
  • Loading branch information
rsvoboda authored and Sgitario committed Aug 5, 2021
1 parent e171e2c commit e46ae46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ private String fileExtension(String uri) {

private void assertContent(JsonObject content) {
assertThat(content.getJsonArray("tags").encode(), is(EXPECTED_TAGS));
assertThat(content.getJsonObject("info").encode(), is(EXPECTED_INFO));
assertThat(content.getJsonObject("info").encode(), is(getExpectedInfo()));
assertTrue(content.getJsonObject("components").getJsonObject("schemas").containsKey("Score"),
"Expected component.schema.Score object.");
assertTrue(content.getJsonObject("paths").containsKey("/rest-ping"), "Missing expected path: /rest-ping");
assertTrue(content.getJsonObject("paths").containsKey("/rest-pong"), "Missing expected path: /rest-pong");
}

String getExpectedInfo() {
return EXPECTED_INFO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@

@NativeImageTest
public class OpenApiTestIT extends OpenApiTest {
// quarkus-maven-plugin:build adjusts OpenAPI info
// see https://github.com/quarkusio/quarkus/pull/19148/commits/8fe04d7a06aa976e0b85d72864578f3ab834a27a
// surefire is executed before quarkus-maven-plugin:build and thus the message there is the generic one
private static final String QUARKUS_ADJUSTED_INFO = "{\"title\":\"013-quarkus-oidc-restclient API\",\"version\":\"1.0.0-SNAPSHOT\"}";

@Override
String getExpectedInfo() {
return QUARKUS_ADJUSTED_INFO;
}
}

0 comments on commit e46ae46

Please sign in to comment.