title: Mocking Util class's static method using gmock
body: <pre><code>class SomeService{
    public String getValue(){
       return SomeUtil.generateValue();
    }
  }
  
  class SomeUtil{
     public static String generateValue() {
        return "yahoo";
     }
  }
  </code></pre>
  
  <p>I want to unit test the <code>SomeService.getValue</code> method.</p>
  
  <p>I am trying the following:</p>
  
  <pre><code>@Test
  void "getValue should return whatever util gives"(){
      def mockSomeUtil = mock(SomeUtil)
      mockSomeUtil.static.generateValue().returns("blah")
      play {
          Assert.assertEquals(someService.getValue(), "blah")
      }
  }
  </code></pre>
  
  <p>But it fails as the util method isn't actually getting mocked.</p>
  
  <p><strong>Question</strong>: </p>
  
  <p>How can I unit test my service method?</p>