title: MockBean doesn't work in Spring boot integration test
body: <p>I have Spring Integration test where I'm trying to Mock some of my Beans. For some reason although I Mocked them they are NULL. Here is code snippet:</p>
  
  <p>The Bean which I want to Mock</p>
  
  <pre><code>@Component
  public class MockWS {
  
      public String callSoapClient() throws JAXBException{
          return "CallSoapCl";
      }
  }
  </code></pre>
  
  <p>The class where the Bean is used</p>
  
  <pre><code>public class SmDpES2PortImpl implements ES2SmDp {
      @Autowired
      private MockWS mock;
  
      @Override
      public void es2DownloadProfile(ES2DownloadProfileRequest parameters) {
           try {
              LOG.info("\n\n\n TEST BEAN: " + mock.callSoapClient() + "\n\n");
            }
       }  
  }
  </code></pre>
  
  <p>Spring boot integration test where the Bean has been mocked </p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
  @FixMethodOrder(MethodSorters.NAME_ASCENDING)
  public class ES2SmDpApplicationTests {
  
      @MockBean(name="mockWS")
      MockWS mockService;
  
      @Test
      public void test1Es2DownloadProfile_Sucess() throws MalformedURLException, JAXBException, SOAPException {
          when(mockService.callSoapClient()).thenReturn("CallMockCLient");
      }
  }
  </code></pre>
  
  <p>Output from the build execution:  <strong>TEST BEAN: null</strong></p>