title: actual implementation is getting triggered when using MockRestServiceServer
body: <p>I am using resttemplate to call other rest services. And writing junit for the same. While running it is returning null that says it is not using mock implementation </p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  public class OrganizationEmployeeServiceTest {
  
      @Mock
      private RestTemplate restTemplate;
  
      @InjectMocks
      private OrganizationEmployeeServiceImpl organizationEmployeeService;
  
      private MockRestServiceServer mockServer;
  
      @Before
      public void setUp() {
          mockServer = MockRestServiceServer.createServer(restTemplate);
      }
  
      @After
      public void tearDown() {
          restTemplate = null;
          organizationEmployeeService = null;
      }
  
      @Test
      public void testMockCreation() {
          assertNotNull(restTemplate);
      }
  
      @Test
      public void testGetEmployeesByOrganizationId() throws JsonProcessingException {
          List&lt;Employee&gt; testEmployees = new ArrayList&lt;Employee&gt;();
          Employee employee1 = new Employee();
          employee1.setEmployeeId(11);
          employee1.setName("malav1");
          employee1.setCity("bangalore1");
          employee1.setOrganizationId(29);
          testEmployees.add(employee1);
  
          Employee employee2 = new Employee();
          employee1.setEmployeeId(12);
          employee1.setName("malav2");
          employee1.setCity("bangalore2");
          employee1.setOrganizationId(29);
          testEmployees.add(employee2);
          ObjectMapper objectMapper = new ObjectMapper();
          String result = objectMapper.writeValueAsString(testEmployees);
  
          mockServer.expect(requestTo("http://localhost:8080/springjpacontroller/employees/29")).andExpect(method(HttpMethod.GET))
                  .andRespond(withSuccess(result, MediaType.APPLICATION_JSON));
  
          List&lt;Employee&gt; resultEmployees = organizationEmployeeService.getEmployeesByOrganizationId(29);
          assertNotNull(resultEmployees);
          mockServer.verify();
      }
  }
  </code></pre>
  
  <p>service class method:</p>
  
  <pre><code>@Autowired
      RestTemplate restTemplate;
  
      public void setRestTemplate(RestTemplate restTemplate){
          this.restTemplate = restTemplate;
      }
  
      @Override
      public List&lt;Employee&gt; getEmployeesByOrganizationId(int organizationId) {
          Employee[] employees = restTemplate.getForObject(
                  "http://localhost:8080/"+ EMPLOYEE_SERVICE_ENDPOINT + organizationId, Employee[].class);
          return Arrays.asList(employees);
      }
  </code></pre>
  
  <p>here while running the junit it giving assertinerror because this employeesresult is null.</p>