Skip to content

Commit d99c82e

Browse files
committed
Improve test assert for method injection with request scope
1 parent 2b36460 commit d99c82e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

inject-test/src/test/java/org/example/request/JexControllerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ void uses_factory_taking_context() {
1717
assertNull(SystemContext.getBean(JexController.class));
1818

1919
final JexController$factory factory = SystemContext.getBean(JexController$factory.class);
20-
final JexController jexController = factory.create(Mockito.mock(Context.class));
20+
final Context context = Mockito.mock(Context.class);
21+
final JexController jexController = factory.create(context);
2122

2223
assertNotNull(jexController);
2324
assertSame(factory.service0, jexController.service);
2425
assertSame(jexController.service, SystemContext.getBean(AService.class));
26+
assertSame(jexController.context, context);
2527
}
2628
}

0 commit comments

Comments
 (0)