-
Notifications
You must be signed in to change notification settings - Fork 1
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
@Mock
doesn't work when using nima test
#14
Comments
hmm, would this be an inject bug or an avaje nima bug? |
once again, the error is mine, it seems I get it working if I don't add static when injecting the client |
This does not make sense to me in that both static and non-static/instance are valid scopes. Did this test use |
Right, so the HttpClient is static scope ... and that means that the http server that it will hit/access is also "wired" to the static scope. So the If it was the other way around [in terms of static scope and instance scope] like: @Inject HttpClient client;
static @Mock Service mocky; Or the same scope [both static or both instance scope] ... then tests can use both.
This statement is NOT correct. It is getting added to a beanScope ... it's that there are MULTIPLE BeanScopes (the static one and the instance one). The static scoped HttpClient will hit the static scoped Helidon instance (and that instance is created once at static class beforeAll time ... |
Got an actual problem this time, when using
@Mock
and injecting an Http Client the client is injected into the test class but themocked bean does not replace the one in the scope.
The text was updated successfully, but these errors were encountered: