title: Mockito InjectMocks into static object
body: <p>I have something like this</p>
  
  <pre><code>@Component
  public class TestController {
  
      @Autowired
      private TestService testService;
  
      public String getSomething(String parameter1) {
          return testService.fetchSomething(parameter1);
      }
  }
  </code></pre>
  
  <p>And I am covering it with tests and have the following problem:</p>
  
  <pre><code>@RunWith(MockitoJUnitRunner.class)
  public class TestControllerTest {
      private static TestService testService = mock(TestService.class);
      @InjectMocks
      private static TestController testController = new TestController();
  
      ....
  }
  </code></pre>
  
  <p>These fields are static because I need them for @ClassRule.</p>
  
  <p>The problem is that in this case injection doesn't work, and testService is null in testController.</p>
  
  <p>Is it possible to provide injection into static object (without constructor creation in Controller)? 
      Or maybe there is another workaround for this?</p>
  
  <p>The question is not about mocking static methods, but injecting mocks into static objects
  Will appreciate any advice, thanks.</p>