when(retryPolicyTemplate.execute(retryCallbackArgumentCaptor.capture(), Matchers.<WorkManager>any())).then(new Answer<Object>()
{
public Object answer(InvocationOnMock invocationOnMock) throws Throwable
{
RetryCallback retryCallback = retryCallbackArgumentCaptor.getValue();
retryCallback.doWork(null);
return null;
}
});
Connection expectedConnection = mock(Connection.class);