title: Mocking Joda DateTime method using Mockito
body: <p>I want <code>millis</code> to return specified value.</p>
  
  <pre><code>public long myMethod(){
      DateTime nowDateTime = new DateTime(DateTimeZone.UTC);
      long millis = nowDateTime.getMillis();
      System.out.println(millis);
  }
  </code></pre>
  
  <p>I tried this with no luck.</p>
  
  <pre><code>@RunWith(PowerMockRunner.class)
  @PrepareForTest({ DateTime.class })
  @PowerMockIgnore({ "javax.crypto.*", "javax.management*" })
  ...
  ...
  public void testMyMethod(){
      DateTime nowDateTime = PowerMockito.mock(DateTime.class);
      Mockito.when(nowDateTime.getMillis()).thenReturn(10L);
  }
  </code></pre>
  
  <p>How can I fix this?</p>