title: How to inject HttpServletRequest into ContainerRequestFilter with Mockito @InjectMocks
body: <p>I can't copy the exact code here but I will put a sample class that explains the problem I am facing.</p>
  
  <pre><code>public XYZ implements ContainerRequestFilter{
  
      @Context
      HttpServletRequest httpServletRequest;
  
      @Override
      public void filter(ContainerRequestContext abc){
          //rest of the code below where httpServletRequest is used inside 
      }
  }
  </code></pre>
  
  <p>So when I write a write test code using <code>@InjectMocks</code>, the <code>HttpServletRequest</code> instance is not injected and is null.</p>
  
  <p>Can anyone help me here what I am misssing. </p>
  
  <p>I have even used the following in <code>@Before</code> method but still no resolution.</p>
  
  <pre><code>MockitoAnnotations.initMocks(this);
  </code></pre>