Replies: 1 comment
-
@tol3ador If your endpoint had an injected Quarkus and also: https://quarkus.io/guides/security-customization#jaxrs-security-context If you do prefer to keep |
Beta Was this translation helpful? Give feedback.
-
@tol3ador If your endpoint had an injected Quarkus and also: https://quarkus.io/guides/security-customization#jaxrs-security-context If you do prefer to keep |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Custom class that has jakarta core @( at )Context SecurityContext throws following exception:
Method threw 'java.lang.IllegalStateException' exception. Cannot evaluate jakarta.ws.rs.core.ContextProducers_ProducerMethod_securityContext_4dee4dfc4a691eaefdabc3490f54879a07ccb609_ClientProxy.toString()
This happens when I do testing and invoking service method to test, which has this custom class injected. We utilize SecurityContext to retrieve some information and do some checks later in code.
Custom class is @RequestScoped.
We tried some different approaches from Quarkus documentation but without success. Is there a way to mock or initialize SecurityContext when doing unit tests or to have it in some test scope? How do you do unit test when having @context SecurityContext usage?
Beta Was this translation helpful? Give feedback.
All reactions