Skip to content

Commit

Permalink
details
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinemeyer committed Nov 14, 2024
1 parent 895cccc commit fa91f13
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void beforeTestClass(TestContext testContext) throws Exception {
beanField.setAccessible(true);
final Object beanFieldValue = ReflectionUtils.getField(beanField, inBean);
final TargetSource proxyTarget = BeanUtils.getProxyTarget(beanFieldValue);
BeanFieldState beanFieldState;
final BeanFieldState beanFieldState;
if (proxyTarget != null) {
beanFieldState = new ProxiedBeanFieldState(inBean, beanField, beanFieldValue, proxyTarget, definition);
} else {
Expand Down Expand Up @@ -116,6 +116,7 @@ public void beforeTestMethod(TestContext testContext) throws Exception {
//if the target bean has been spied on, need to push into this spy as well (to allow mock in spies)
Optional.ofNullable(spyTracker.get(bean))
.ifPresent(spy ->inject(fieldState.field, spy, mockOrSpy));

});

super.beforeTestMethod(testContext);
Expand Down

0 comments on commit fa91f13

Please sign in to comment.