-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
@Singleton bean with @ServerRequestFilter is removed in @QuarkusTest #26635
Comments
Adding @Unremoveable to the LoggingFilter bean fixes the issue... is that the correct approach? After reading https://quarkus.io/blog/unused-beans/ I would assume the the filter should be recognized by the resteasy extension, and not removed? Also, adding |
/cc @FroMage, @stuartwdouglas |
Do you mind sharing a project that exhibits the problem with a failing test? Thanks |
I shared the project here: Running com.easypass.GreetingResourceTest#testHelloEndpoint generates logs if the @unremovable annotation is present only. |
I tried your sample and works flawlessly with or without |
Describe the bug
Starting from a barebone Greeting project:
I have added a single LoggingFilter bean:
The filter works fine if I start Quarkus in dev mode using the quarkus:dev maven goal:
... however the filter is not registered when running QuarkusTest or QuarkusIntegrationTest:
The test passes but requests/responses are not logged
Expected behavior
I would expect the LoggingFilter to be registered, and to log requests & responses
Actual behavior
No response
How to Reproduce?
Create Greeting project, add LoggingFilter class, and run GreetingResourceTest
Output of
uname -a
orver
No response
Output of
java -version
openjdk version "18.0.1.1" 2022-04-22 OpenJDK Runtime Environment (build 18.0.1.1+2-6) OpenJDK 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.9.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /opt/homebrew/Cellar/maven/3.8.5/libexec
Java version: 18.0.1.1, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/18.0.1.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_FR, platform encoding: UTF-8
OS name: "mac os x", version: "12.4", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: