I'm facing the exception
java.lang.IllegalAccessError: class org.mockito.Matchers tried to access private method 'void org.mockito.internal.progress.ThreadSafeMockingProgress.()' (org.mockito.Matchers and org.mockito.internal.progress.ThreadSafeMockingProgress are in unnamed module of loader 'app')
at org.mockito.Matchers.(Matchers.java:107)
when I try to use the matcher any() in mockito when() stub call. The class argument type is for "NewOrder" from the binance spot java library here
I'm trying to do
when(mockBinanceApiRestClient.newOrder(any(NewOrder.class))).thenReturn(buyOrderResp);
mocking the BinanceApiRestClient. The any() and when() are static imports from org.mockito.Mockito. This is such a nightmare why it wouldn't work. Any help is much appreciated.