1

I am updating to JDK17 and it seems PowerMock is not compatible, as a result one of my test classes is not working and the code that I am trying to replace is :

whenNew(A::class.java).withAnyArguments().thenAnswer {invocations -> ClassB( arg1 , invocation.getArguemnt(0) ) }

I tried Mockito and Mockk but couldn't achieve the proper result.

I tried mockedConstruction and also Mockito.mockConstruction, maybe I am doing it wrong. Anyone knows a good alternative for it?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.