title: How to verify static void method has been called with power mockito
body: <p>I am using the following.</p>
  
  <pre><code>Powermock-mockito 1.5.12
  Mockito 1.95
  junit 4.11
  </code></pre>
  
  <p>Here is my utils class</p>
  
  <pre><code>public void InternalUtils {
      public static void sendEmail(String from, String[] to, String msg, String body) {
      }
  }
  </code></pre>
  
  <p>here is gist of the class under test:</p>
  
  <pre><code>public class InternalService {
         public void processOrder(Order order) {
             if (order.isSuccessful()) {
                 InternalUtils.sendEmail(...);
             }
         }
  }
  </code></pre>
  
  <p>And here is the test:</p>
  
  <pre><code>@PrepareForTest({InternalUtils.class})
  @RunWith(PowerMockRunner.class)
  public class InternalService {
     public void verifyEmailSend() {
          mockStatic(Internalutils.class);
          doNothing().when(InternalUtils, "sendEmail", anyString(), any(String.class), anyString(), anyString());
          Order order = mock(Order.class);
          when(order.isSuccessful()).thenReturn(true);
          InternalService is = new InternalService();
  
          verifyStatic(times(1));
          is.processOrder(order);
     }
  }
  </code></pre>
  
  <p>The above test fails. The verification mode given is none, but according to the code, if order is successful than email must be send. </p>