@Test
public void testRetryExceptionWithRecovery() throws Throwable {

    Mockito.doReturn(TEST_RETRY_TEMPLATE_RECOVERY).when(mockAnnotation).recoveryCallbackName();
    org.springframework.retry.support.RetryTemplate template =
            new org.springframework.retry.support.RetryTemplate();
    Map<Class<? extends Throwable>, Boolean> exceptionMap = new HashMap<Class<? extends Throwable>, Boolean>();
    exceptionMap.put(RuntimeException.class, Boolean.TRUE);
    template.setRetryPolicy(new SimpleRetryPolicy(1, exceptionMap));
    Mockito.doReturn(template).when(beanFactory)
            .getBean(TEST_RETRY_TEMPLATE, org.springframework.retry.support.RetryTemplate.class);
    Mockito.doReturn(recoveryCallback).when(beanFactory)
            .getBean(TEST_RETRY_TEMPLATE_RECOVERY, RecoveryCallback.class);
    Mockito.doThrow(new RuntimeException()).when(mockPjp).proceed();
    Mockito.doReturn("a").when(recoveryCallback).recover(Mockito.any(RetryContext.class));
    Assert.assertEquals("a", aspect.retry(mockPjp, mockAnnotation));
    Mockito.verify(mockPjp, Mockito.times(1)).proceed();
}