Skip to content

Commit

Permalink
test summary on Info annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-confino committed May 8, 2024
1 parent 16a1c45 commit 265c21a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ConfigExtensionsTest extends JaxRsDataObjectScannerTestBase {
private static final String TITLE = "mp.openapi.extensions.smallrye.info.title";
private static final String VERSION = "mp.openapi.extensions.smallrye.info.version";
private static final String DESCRIPTION = "mp.openapi.extensions.smallrye.info.description";
private static final String SUMMARY = "mp.openapi.extensions.smallrye.info.summary";
private static final String TERMS = "mp.openapi.extensions.smallrye.info.termsOfService";
private static final String CONTACT_EMAIL = "mp.openapi.extensions.smallrye.info.contact.email";
private static final String CONTACT_NAME = "mp.openapi.extensions.smallrye.info.contact.name";
Expand Down Expand Up @@ -85,10 +86,10 @@ void testSettingJustLicenseName() throws IOException, JSONException {

@Test
void testSettingAllInfo() throws IOException, JSONException {

System.setProperty(TITLE, "My own awesome REST service");
System.setProperty(VERSION, "1.2.3");
System.setProperty(DESCRIPTION, "This service is awesome");
System.setProperty(SUMMARY, "This summary is rather boring");
System.setProperty(TERMS, "The terms is also awesome");
System.setProperty(CONTACT_EMAIL, "[email protected]");
System.setProperty(CONTACT_NAME, "Phillip Kruger");
Expand All @@ -109,6 +110,7 @@ void testSettingAllInfo() throws IOException, JSONException {
System.clearProperty(TITLE);
System.clearProperty(VERSION);
System.clearProperty(DESCRIPTION);
System.clearProperty(SUMMARY);
System.clearProperty(TERMS);
System.clearProperty(CONTACT_EMAIL);
System.clearProperty(CONTACT_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"title" : "My own awesome REST service",
"description" : "This service is awesome",
"termsOfService" : "The terms is also awesome",
"summary" : "This summary is rather boring",
"contact" : {
"name" : "Phillip Kruger",
"url" : "https://www.phillip-kruger.com",
Expand Down Expand Up @@ -182,4 +183,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void taskPropertiesInheritance() {
ext.infoLicenseUrl.set("info-license-url");
ext.infoTermsOfService.set("info-tos");
ext.infoTitle.set("info-title");
ext.infoSummary.set("info-summary");
ext.infoVersion.set("info-version");
ext.modelReader.set("model-reader");
ext.operationIdStrategy.set(OperationIdStrategy.CLASS_METHOD);
Expand Down Expand Up @@ -112,6 +113,7 @@ void taskPropertiesInheritance() {
SmallryeOpenApiProperties::getInfoDescription,
SmallryeOpenApiProperties::getInfoLicenseName,
SmallryeOpenApiProperties::getInfoLicenseUrl,
SmallryeOpenApiProperties::getInfoSummary,
SmallryeOpenApiProperties::getInfoTermsOfService,
SmallryeOpenApiProperties::getInfoTitle,
SmallryeOpenApiProperties::getInfoVersion,
Expand Down Expand Up @@ -199,6 +201,7 @@ void smokeProject(Path buildDir, boolean withQuarkus, String taskName, String ou
" infoVersion.set(\"Info Version\")",
" infoDescription.set(\"Info Description\")",
" infoTermsOfService.set(\"Info TOS\")",
" infoSummary.set(\"Info Summary\")",
" infoContactEmail.set(\"Info Email\")",
" infoContactName.set(\"Info Contact\")",
" infoContactUrl.set(\"https://github.com/smallrye/smallrye-open-api/issues/1231\")",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void basic_info(MavenExecutionResult result) throws IOException {
assertEquals(properties.get("infoTitle"), schema.getInfo().getTitle());
assertEquals(properties.get("infoDescription"), schema.getInfo().getDescription());
assertEquals(properties.get("infoTermsOfService"), schema.getInfo().getTermsOfService());
assertEquals(properties.get("infoSummary"), schema.getInfo().getSummary());
assertEquals(properties.get("infoContactName"), schema.getInfo().getContact().getName());
assertEquals(properties.get("infoContactUrl"), schema.getInfo().getContact().getUrl());
assertEquals(properties.get("infoContactEmail"), schema.getInfo().getContact().getEmail());
Expand Down

0 comments on commit 265c21a

Please sign in to comment.