Spring's @Retryable not working when running JUnit Test
<p>I have this test:</p>

<pre><code>@RunWith(MockitoJUnitRunner.class)
public class myServiceTest {

@InjectMocks
myService subject;

private myService spy;

@Before
public void before() {
    spy = spy(subject);
}

@Test
public void testing() {

    when(spy.print2()).thenThrow(new RuntimeException()).thenThrow(new RuntimeException()).thenReturn("completed");
    spy.print1();
    verify(spy, times(3)).print2();
}
</code></pre>

<p>and then I have:</p>

<pre><code>@Service("myService")
public class myService extends myAbstractServiceClass {


public String print1() {
    String temp = "";
    temp = print2();
    return temp;
}

 @Retryable
 public String print2() {
     return "completed";
 }
}
</code></pre>

<p>then I have this interface(which my abstractService implements):</p>

<pre><code>public interface myServiceInterface {

    @Retryable(maxAttempts = 3)
    String print1() throws RuntimeException;

    @Retryable(maxAttempts = 3)
    String print2() throws RuntimeException;

}
</code></pre>

<p>but, I get a runtimeexception thrown when I run the test, leading me to believe it is not retrying. Am I doing this wrong? </p>