title: How to use @MockBean in Spring boot 1.2.5.RELEASE
body: <p>I am trying to write junit test cases for my Spring boot application written in <strong>1.2.5.RELEASE</strong> version</p>
  <p>I have read the spring boot documentation <a href="https://docs.spring.io/spring-boot/docs/1.2.5.RELEASE/reference/htmlsingle/" rel="nofollow noreferrer">https://docs.spring.io/spring-boot/docs/1.2.5.RELEASE/reference/htmlsingle/</a> and trying to write the test case.<br>
  Now I want to mock a class which is already a @Primary class in original application. <br></p>
  <p>see the issue here - <a href="https://stackoverflow.com/questions/49649044/how-to-mock-a-class-that-been-annotated-with-primary">How to mock a class that been annotated with Primary</a></p>
  <p>On further read I understand that I need to use @MockBean to mock a class which is already a primary in application. But the problem is the spring boot version which I use does not support @MockBean.<br>
  I have tried overriding spring-boot-starter-test version alone with 2.1.7.RELEASE(without changing the spring boot parent version as I am not supposed to change the application spring boot version which has many impacts). Now I am able to use @MockBean, but on running the test case, it ends in exception.
  <br> <code>java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.getRepeatableAnnotations</code></p>
  <ol>
  <li><p>How can I use @MockBean in spring boot <strong>1.2.5.RELEASE</strong>?</p>
  </li>
  <li><p>Is there any workaround without using <strong>@MockBean</strong>?</p>
  </li>
  </ol>