-
Notifications
You must be signed in to change notification settings - Fork 83
Add comprehensive annotation extension tests #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The default MicroProfile formatting rules currently don't allow annotation properties to wrap on a new line, which makes it hard to maintain the TCK test applications because MP OpenAPI contains large annotations with lots of attributes. This change overrides the default formatter config XML file for the tck project with one which has an additional property, allowing annotation properties to wrap.
I've put this in draft for the moment as smallrye-open-api isn't producing some of the extensions correctly yet so I can't verify that I've written the assertions correctly. |
I now have these passing under Smallrye OpenAPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Azquelt
Make sure the TCK exercises the extensions attribute on every annotation which has one.
c3592a6
to
4b971e0
Compare
As I went to merge this, I spotted that I'd squashed my last typo changes into the wrong commit and they hadn't been included in this PR, I've just updated it to include them and re-run the tests against smallrye. Fixes are: @@ -100,7 +100,7 @@ public class AirlinesAppTest extends AppTestBase {
ValidatableResponse vr = callEndpoint(type);
vr.body("externalDocs.description", equalTo("instructions for how to deploy this app"));
vr.body("externalDocs.url", containsString("README.md"));
- vr.body("externalDocs.x-external-docs", equalTo("text-external-docs"));
+ vr.body("externalDocs.x-external-docs", equalTo("test-external-docs"));
}
@RunAsClient
@@ -434,7 +434,7 @@ public class AirlinesAppTest extends AppTestBase {
vr.body(availabilityParameters + ".findAll { it.name == 'numberOfChildren' }.schema.minimum",
both(hasSize(1)).and(contains(0)));
vr.body(availabilityParameters + ".findAll { it.name == 'airportFrom' }.x-parameter",
- equalTo("test-parameter"));
+ contains("test-parameter"));
vr.body(availabilityParameters + ".findAll { it.$ref == '#/components/parameters/departureDate'}",
notNullValue());
@@ -462,7 +462,7 @@ public class AirlinesAppTest extends AppTestBase {
endpoint = "paths.'/reviews'.post.callbacks";
vr.body(endpoint, hasKey("testCallback"));
vr.body(endpoint + ".testCallback", hasKey("http://localhost:9080/oas3-airlines/reviews"));
- vr.body(endpoint + "testCallback.x-callback", equalTo("test-callback"));
+ vr.body(endpoint + ".testCallback.x-callback", equalTo("test-callback"));
endpoint = "paths.'/bookings'.post.callbacks";
vr.body(endpoint, hasKey("bookingCallback")); |
Make sure the TCK exercises the
extensions
attribute on every annotation which has one.To write the tests, I had to make changes to the annotations on
JAXRSApp
which had been mangled by the formatter, so as a prerequisite step I added a tweak to the standard microprofile formatting rules and reformatted the code. The update and reformatting are done in separate commits.For #387