-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23431 from phillip-kruger/additional-docs-fix
Small fix for non-existing openapi additional folder
- Loading branch information
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...rc/test/java/io/quarkus/smallrye/openapi/test/jaxrs/OpenApiEmptyStaticModelsTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.quarkus.smallrye.openapi.test.jaxrs; | ||
|
||
import java.io.IOException; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class OpenApiEmptyStaticModelsTestCase { | ||
|
||
private static String directory = "META-INF/foldernamethatdoesnotexist"; | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest runner = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(OpenApiResource.class, ResourceBean.class) | ||
.addAsResource( | ||
new StringAsset("quarkus.smallrye-openapi.additional-docs-directory=" + directory), | ||
"application.properties")); | ||
|
||
@Test | ||
public void testNonExistingAdditionalDocsDirectory() throws IOException { | ||
|
||
RestAssured.given().header("Accept", "application/json") | ||
.when().get("/q/openapi") | ||
.then() | ||
.log().body().and() | ||
.body("openapi", Matchers.startsWith("3.0.")); | ||
} | ||
} |