@Test(expected = BeanNotOfRequiredTypeException.class)
public void testRetryWithWrongBeanType() throws Throwable {

    Mockito.doThrow(new BeanNotOfRequiredTypeException("", String.class, String.class)).when(beanFactory)
            .getBean(TEST_RETRY_TEMPLATE, org.springframework.retry.support.RetryTemplate.class);
    try {
        aspect.retry(mockPjp, mockAnnotation);
    }
    finally {
        Mockito.verify(mockPjp, Mockito.never()).proceed();
    }
}