Following this discussion: What is the difference between @ExtendWith(SpringExtension.class) and @ExtendWith(MockitoExtension.class)?
I would like to know if there is any performance improvement when using one option over the other. Has anyone conducted tests on this? Are there any available documents or resources discussing this?
Apples and oranges. If you need to test beans, you must use the Spring extension. If you use regular Mockito mocks, use the Mockito extension. Starting and initializing a Spring context is slower than not doing it (by order(s) of magnitude), even for an empty application.
When you require a Spring context, you must use the Spring extension. If you don't need the context, then Mockito extension will almost certainly be faster, because it has to perform less work. It doesn't matter how fast B is if it cannot be used in your use-case that requires functionality that only A offers.