Skip to content

Commit 09d452a

Browse files
authored
Merge pull request quarkusio#47879 from geoand/quarkusio#27349
Make MockSupport methods synchronized
2 parents 44dcf5d + e8f4f95 commit 09d452a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test-framework/junit5/src/main/java/io/quarkus/test/junit/MockSupport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class MockSupport {
1313

1414
private static final Deque<List<Object>> contexts = new ArrayDeque<>();
1515

16-
static void pushContext() {
16+
static synchronized void pushContext() {
1717
contexts.push(new ArrayList<>());
1818
}
1919

20-
static void popContext() {
20+
static synchronized void popContext() {
2121
if (contexts.isEmpty()) {
2222
return; // can happen on error in QuarkusTestResourceLifecycleManagers etc.
2323
}
@@ -38,7 +38,7 @@ static void popContext() {
3838
}
3939
}
4040

41-
static <T> void installMock(T instance, T mock) {
41+
static synchronized <T> void installMock(T instance, T mock) {
4242
//due to class loading issues we can't access the interface directly
4343
List<Object> inst = contexts.peek();
4444
if (inst == null) {

0 commit comments

Comments
 (0)