title: How to suppress and verify private static method calls?
body: <p>I am currently stumbling in JUnit testing and need some help. So I got this class with static methods which will refactor some objects. For simplification's sake I have made a small example. This is my Factory class:</p>
  
  <pre><code>class Factory {
  
      public static String factorObject() throws Exception {
          String s = "Hello Mary Lou";
          checkString(s);
          return s;
      }
  
      private static void checkString(String s) throws Exception {
          throw new Exception();
      }
  }
  </code></pre>
  
  <p>And this is my Test class:</p>
  
  <pre><code>@RunWith(PowerMockRunner.class)
  @PrepareForTest({ Factory.class })        
  public class Tests extends TestCase {
  
      public void testFactory() throws Exception {
  
          mockStatic(Factory.class);
          suppress(method(Factory.class, "checkString"));
          String s = Factory.factorObject();
          assertEquals("Hello Mary Lou", s);
      }
  }
  </code></pre>
  
  <p>Basically what I tried to achieve is that the private method checkString() should be suppressed (so the Exception is not thrown), and also need to verify that the method checkString() was actually called in the method factorObject(). </p>
  
  <p><strong>UPDATED</strong>:
  The suppression works correctly with the following code:</p>
  
  <pre><code>suppress(method(Factory.class, "checkString", String.class));
  String s = Factory.factorObject();
  </code></pre>
  
  <p>... however it returns me NULL for the String "s". Why is that?</p>