-
Notifications
You must be signed in to change notification settings - Fork 872
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
Convert jaxrs tests to java #12816
Convert jaxrs tests to java #12816
Conversation
...esting/src/main/java/io/opentelemetry/instrumentation/jaxrs/v2_0/test/JaxRsTestResource.java
Outdated
Show resolved
Hide resolved
...agent/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/CxfFilterTest.java
Outdated
Show resolved
Hide resolved
...agent/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/CxfFilterTest.java
Outdated
Show resolved
Hide resolved
protected void configure(HttpServerTestOptions options) { | ||
super.configure(options); | ||
|
||
options.setResponseCodeOnNonStandardHttpMethod(500); |
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.
the groovy test had a conditional to use 500 for testLatestDeps and 405 otherwise. I see you implemented that in the Jetty test, but that was not needed here as well? I assume not since the tests are all passing
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.
It is not needed because of using a lambda in
serverFactory.setProvider(
(ExceptionMapper<Exception>)
exception ->
Response.status(500)
.type(MediaType.TEXT_PLAIN_TYPE)
.entity(exception.getMessage())
.build());
When choosing an exception mapper cxf inspects the exception mapper classes and ends up choosing between a built in mapper and our mapper. When using regular class it picks the built in one and when using lambda our one for the non standard http method test.
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.
thank you for the explanation
part of #7195