title: Unit test - Problems testing @Retryable and @Recover
body: <p>I have a component that's using @Retryable annotation and another service using that component. So I'm trying to test that the component using @Retryable annotation is actually retrying.</p>
  
  <p>I've tried every solution there is on the web right now but nothing worked for me. I'm trying to create a unit test for this and not integration test. So far I've managed to get to the exception that's supposed to be thrown and @Retryable wasn't even retrying, the method just threw the exception and thats it.</p>
  
  <p>This is the component using Retryable annotation:</p>
  
  <pre><code>@Component
  public class OurComponent {
  
      @Retryable(maxAttempts = 10,
              backoff = @Backoff(delay = 2000),
              value = {someException.class}
      )
      public void someMethod(SomeObject someObject) throws someException {
          Object createObject = anotherMethod(someObject); //this method throws someException
          ...
      }
  }
  </code></pre>
  
  <p>And the service using this ourComponent:</p>
  
  <pre><code>@Service
  public class someService {
  
      private final OurComponent ourComponent;
  
      public SomeService(OurComponent ourComponent) {
           this.ourComponent = ourComponent;
      }
  
      ...
  
  
      public void methodUsingComponent() {
           SomeObject someObject = new SomeObject(args);
           ourComponent.someMethod(someObject);
      }
  }
  </code></pre>
  
  <p>Now I've tried to @InjectMocks and @MockBean this service and component but it still didn't work. Is it even possible to test @Retryable annotation without doing integration test?</p>