I was earlier using powermock to mock constructors like this way –
BuildingBlockDbHandler blockDbHandler = mock(BuildingBlockDbHandler.class); PowerMockito.whenNew(BuildingBlockDbHandler.class).withAnyArguments().thenReturn(blockDbHandler);
but now I am migrating to mockito, how can I do the same thing in it?
I tried using mockedConstruction but could not find correct way of using it to stub constructor calls.
I expected to stub constructor calls without using powermock.
Arjun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.