File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
inject-test/src/main/java/io/avaje/inject/test Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ Pair obtain(ExtensionContext context) {
34
34
}
35
35
36
36
private void initialise (ExtensionContext context ) {
37
- globalBeanScope = TSBuild .initialise ();
37
+ globalBeanScope = TSBuild .initialise (false );
38
38
log .log (TRACE , "register global test BeanScope with beans {0}" , globalBeanScope );
39
39
context .getRoot ().getStore (ExtensionContext .Namespace .GLOBAL ).put (InjectExtension .class .getCanonicalName (), this );
40
40
}
Original file line number Diff line number Diff line change 21
21
final class TSBuild {
22
22
23
23
private static final ReentrantLock lock = new ReentrantLock ();
24
- private static BeanScope SCOPE ;
24
+ private static GlobalTestScope . Pair SCOPE ;
25
25
26
26
private final boolean shutdownHook ;
27
27
@@ -37,12 +37,11 @@ static BeanScope createTestBaseScope(boolean shutdownHook) {
37
37
/**
38
38
* Return the test BeanScope only creating once.
39
39
*/
40
- @ Nullable
41
- static BeanScope initialise (boolean shutdownHook ) {
40
+ static GlobalTestScope .Pair initialise (boolean shutdownHook ) {
42
41
lock .lock ();
43
42
try {
44
43
if (SCOPE == null ) {
45
- SCOPE = createTestBaseScope (shutdownHook );
44
+ SCOPE = createScopes (shutdownHook );
46
45
}
47
46
return SCOPE ;
48
47
} finally {
@@ -54,8 +53,8 @@ static BeanScope initialise(boolean shutdownHook) {
54
53
this .shutdownHook = shutdownHook ;
55
54
}
56
55
57
- static GlobalTestScope .Pair initialise ( ) {
58
- BeanScope testBaseScope = createTestBaseScope (false );
56
+ private static GlobalTestScope .Pair createScopes ( boolean shutdownHook ) {
57
+ BeanScope testBaseScope = createTestBaseScope (shutdownHook );
59
58
BeanScope testAllScope = createTestAllScope (testBaseScope );
60
59
return new GlobalTestScope .Pair (testAllScope , testBaseScope );
61
60
}
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ public abstract class TestBeanScope {
38
38
* @return A new test BeanScope with the global "test scope" as its parent.
39
39
*/
40
40
public static BeanScopeBuilder builder () {
41
- BeanScope globalTestScope = init (true );
42
- return BeanScope .builder ().parent (globalTestScope , false );
41
+ BeanScope baseTestScope = init (true );
42
+ return BeanScope .builder ().parent (baseTestScope , false );
43
43
}
44
44
45
45
/**
@@ -79,7 +79,7 @@ public static BeanScope create(boolean shutdownHook) {
79
79
80
80
@ Nullable
81
81
static BeanScope init (boolean shutdownHook ) {
82
- return TSBuild .initialise (shutdownHook );
82
+ return TSBuild .initialise (shutdownHook ). baseScope () ;
83
83
}
84
84
85
85
}
You can’t perform that action at this time.
0 commit comments