I’m getting mockito exception when doing the stubbing:
<code>@Mock
RetryTemplate retryTemplate;
@Test
public void testSubmitCreditTransaction() {
when(retryTemplate.execute(any())).thenAnswer(invocation -> {
RetryCallback retry = invocation.getArgument(0);
return retry.doWithRetry(null);
});
...
}
</code>
<code>@Mock
RetryTemplate retryTemplate;
@Test
public void testSubmitCreditTransaction() {
when(retryTemplate.execute(any())).thenAnswer(invocation -> {
RetryCallback retry = invocation.getArgument(0);
return retry.doWithRetry(null);
});
...
}
</code>
@Mock
RetryTemplate retryTemplate;
@Test
public void testSubmitCreditTransaction() {
when(retryTemplate.execute(any())).thenAnswer(invocation -> {
RetryCallback retry = invocation.getArgument(0);
return retry.doWithRetry(null);
});
...
}
the exception is:
<code>org.mockito.exceptions.misusing.InvalidUseOfMatchersException
</code>
<code>org.mockito.exceptions.misusing.InvalidUseOfMatchersException
</code>
org.mockito.exceptions.misusing.InvalidUseOfMatchersException
what did I get wrong?