JUnitPerf icon indicating copy to clipboard operation
JUnitPerf copied to clipboard

Support for Mockito

Open bmiranda84 opened this issue 4 years ago • 0 comments

Hello noconnor,

When JUnitPerfRule is used together with Mockito (annotation @RunWith(MockitoJUnitRunner.class)), the mock objects defined on the test are not used anymore, and real objects are used instead. It's like JUnitPerfRule enforces the usage of real objects.

Could you please add support for Mockito?

e.g.

@RunWith(org.mockito.junit.MockitoJUnitRunner.class) public class TestCase { @Rule public JUnitPerfRule perfTestRule = new JUnitPerfRule();

  @InjectMocks
  ClassToMock mock;

  @Spy
  Factory partialMock;

.......

Thanks and best regards, bmiranda

bmiranda84 avatar Jul 06 '21 08:07 bmiranda84