-
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
Support mocking of @Singleton beans #8983
Comments
And for @InjectSpy as well. |
I just faced this problem. I have added |
You can use |
Does convertScopes work for Named beans? I am getting exactly the same error regardless of convertScopes setting:
Quarkus 2.4.1.
|
Can you please open a new issue? Attaching an example application that fails like you mention would be very helpful |
I now understand the issue better.
In that situation, the error message is identical regardless of convertScopes setting so it wasn't obvious if convertScopes was in effect. I now understand its limitations better. |
For anyone working with Quarkus 3 reaching this point:
@InjectMock
@MockitoConfig(convertScopes = true)
EventBus eventBus; // or your favorite singleton |
Description
As a developer, I want to mock
@Singleton
beans.Sometimes, it's not possible to annotate a bean by
@ApplicationScoped
, e.g. in the case described here #8960The text was updated successfully, but these errors were encountered: