title: Jersey - How to mock service
body: <p>I am using "Jersey Test Framework" for unit testing my webservice.</p>
  
  <p>Here is my resource class :</p>
  
  <pre><code>import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.Produces;
  
  // The Java class will be hosted at the URI path "/helloworld" 
  
  @Path("/helloworld") 
  public class class HelloWorldResource {
  
      private SomeService service;
  
      @GET 
      @Produces("text/plain")
      public String getClichedMessage() {
          // Return some cliched textual content
          String responseFromSomeService = service.getSomething();
          return responseFromSomeService;
      }
  }
  </code></pre>
  
  <p>How can I mock SomeService in unit tests ?</p>