Skip to content

Commit

Permalink
Fixed mock beans not injected with @MockBean in JUnit 5
Browse files Browse the repository at this point in the history
  • Loading branch information
sashokbg committed Dec 8, 2022
1 parent 9de55cf commit 6025bb2
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private void notifyTestContextManagerAboutBeforeTestMethod() {
try {
Class<?> delegateTestClass = delegate.getTestContext().getTestClass();
delegateTestInstance = applicationContext.getBean(delegateTestClass);
delegate.prepareTestInstance(delegateTestInstance);
Method dummyMethod = TestContextAdaptor.class.getMethod("cucumberDoesNotHaveASingleTestMethod");
delegate.beforeTestMethod(delegateTestInstance, dummyMethod);
} catch (Exception e) {
Expand Down

0 comments on commit 6025bb2

Please sign in to comment.