-
Notifications
You must be signed in to change notification settings - Fork 61
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
@MockBean is not always used #39
Comments
Provide an example that reproduces. Really you should not be using Primary in combination with MockBean |
@graemerocher
My env:
Might be related to disabling the auto transaction wrapping for tests with two datasources, from this: #28 On the other side, if
Hope that information helps. Thank you in advance! |
Thanks for the example, looking into this now. |
Root cause micronaut-projects/micronaut-core#1740 |
Fixed upstream and will be in 1.1.3 of Micronaut. Thanks for the report. |
@graemerocher 👍 Thanks fox fixing it. |
In a test with
@MicronautTest
we have a mock bean for a JPA repository:I inspected that there is a race condition in picking which bean is used in the test, even with
@Primary
as above. Sometimes the mock bean is used while sometimes the actual RepositoryImpl is used and that is totally random.The text was updated successfully, but these errors were encountered: