How to intercept an argument passed to a mocked construction using Mockito.mockConstruction(datatype.class)

Viewed 94

so I'm currently using the Mockito feature

MockedConstruction <datatype> mocked = Mockito.mockConstruction(datatype.class)

For a unit test I'm writing in Springboot, and I was wondering if there is something similar to ArgumentCaptor that I could use to capture the argument that is being passed to this mocked constructor, as it seems ArgumentCaptor only works for an objects methods and not the constructors of objects. (Trying to avoid using PowerMock if possible)

Any help would be greatly appreciated, thanks!

0 Answers
Related