Skip to content

Commit

Permalink
Testing - fix MockitoConfig(convertScopes = true)
Browse files Browse the repository at this point in the history
- fixes #35080

(cherry picked from commit 806c3f8)
  • Loading branch information
mkouba authored and gsmet committed Aug 1, 2023
1 parent e8cb64a commit cf7630a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectMock;
import io.quarkus.test.junit.mockito.MockitoConfig;

@QuarkusTest
class GreetingSingletonResourceTest {

@InjectMock(convertScopes = true)
MessageServiceSingleton messageService;

@InjectMock(convertScopes = true)
@io.quarkus.test.InjectMock
@MockitoConfig(convertScopes = true)
SuffixServiceSingleton suffixService;

@InjectMock(convertScopes = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void execute(BuildContext context) {
continue;
}
if (instance.name().equals(MOCKITO_CONFIG)
&& instance.target().asField().hasAnnotation(INJECT_MOCK)) {
&& !instance.target().asField().hasAnnotation(INJECT_MOCK)) {
continue;
}
AnnotationValue allowScopeConversionValue = instance.value("convertScopes");
Expand Down

0 comments on commit cf7630a

Please sign in to comment.