-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ArC: introduce CurrentManagedContext, built-in session context, @ActivateSessionContext
#45170
Conversation
mkouba
commented
Dec 17, 2024
- fixes ArC: make it possible to activate the session context for a specific business method in a test #45146
- share the logic used in RequestContext and WebSocketSessionContext
This comment has been minimized.
This comment has been minimized.
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
test-framework/common/src/main/java/io/quarkus/test/ActivateSessionContext.java
Outdated
Show resolved
Hide resolved
* still terminate when the invocation completes and not at the time the asynchronous type is completed. Also note that session | ||
* context is not propagated by MicroProfile Context Propagation. | ||
* <p> | ||
* This interceptor binding is only available in tests. |
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.
Wouldn't it be more convenient to have this in ArC itself with the documentation that it's intended for test usage only?
The context now exists there anyway and you can easily perform the activation anyway. Besides, it would remove some of the registration complexity that you now have in ArcTestSteps
. I do not mind the current setup, I just think it'd be easier this way.
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.
Well, "intended for test" is not the same as "not available outside tests". I mean, for now I'd like to keep it for tests only because it doesn't make a lot of sense elsewhere.
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.
With this PR we already expose Arc.container().sessionContext()
so the 'misuse' is very much possible already.
But let's keep it as-is for now :)
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.
Ofc, it is possible but we don't want to make it even easier...
...ons/arc/deployment/src/test/java/io/quarkus/arc/test/context/session/SessionContextTest.java
Show resolved
Hide resolved
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.
LGTM - but not an expert at all (I'm on the user side :-))
It's always good to have feedback from the user side ;-) |
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.
Added one small note, otherwise LGTM 👍
...ons/arc/deployment/src/test/java/io/quarkus/arc/test/context/session/SessionContextTest.java
Show resolved
Hide resolved
- it's only available in tests - fixes quarkusio#45146 Co-authored-by: Matej Novotny <matej.novotny2@gmail.com>
This comment has been minimized.
This comment has been minimized.
Status for workflow
|
Status for workflow
|