Closed bahrigencsoy closed 2 months ago
Downgrading byte-buddy to 1.14.18 among with slf4j to 2.0.13 seemingly resolves the problem. Neither of them helps individually.
Some MockBeans were identified twice, like
@MockBean(classes = {MyService.class}
public class MyTest {
@MockBean
MyService myService;
}
I don't know why but removing the class level annotation somehow solved the problem. Apparently it didn't solve the problem.
@bahrigencsoy Do you have a sample application that reproduces the issue?
@bahrigencsoy Do you have a sample application that reproduces the issue?
Unfortunately no, I tried but exposed too much business code, and it was not stable. The IDE/maven/CI behaviors are also inconsistent. I had experienced Mockito tests to fail during debug, but this failure is so chaotic that it breaks all the unit tests after, in the CI.
I'm afraid we might not be able to do much to help here. We've not really touched the @MockBean
code between 3.3.2 and 3.3.3 so all indications point towards a Mockto or Byte-Buddy issue. I would suggest raising an issue with the Mockto team. We're just calling Mockito.mockingDetails(mock).isMock()
so I've no idea why that assertion would fail.
I know this issue is closed, but for any others for future reference, this problem occurs with a tasteless combination of:
(Still no PoC project)
This surely was a poor design, but we only noticed it in this minor upgrade.
After performing the minor upgrade from 3.3.2 to 3.3.3, our "SUBCLASS" mocks started to fail with no obvious reason:
The failure is so chaotic that it fails all the tests afterwards. Trying to downgrade bytebuddy version back to 1.14.18 did not solve the problem.