title: Unable to mock static methods using JMockit
body: <p>I am writing a testcase which includes to mock a static method. Though not able to achieve the desired result.</p>
  
  <pre><code>import static org.junit.Assert.assertEquals;
  import org.junit.Test;
  
  import mockit.Mock;
  import mockit.MockUp;
  import mockit.Mocked;
  
  public class MockSubClassTest {
  
  
  @Test
  public void mockSuperClassTest(@Mocked final SuperClass superClass){
  
      new MockUp&lt;Util&gt;() {
          @Mock
          public String getAppName(){
              return "FXI";
          }
      };
  
  
  
      SubClass subClass = new SubClass("data"); 
      assertEquals("data", subClass.getData());
  
      assertEquals("FXI", subClass.getApp());
  
  }
  }
  
  public class SubClass extends SuperClass {
  
  String data;
  
  public SubClass(String string) {
      super(string);
      data = string;
  }
  
  public String getData() {
      return data;
  
  }
  
  }
  
  
  public class SuperClass {
  
  public final static String app = Util.getAppName();
  
  public SuperClass(String data) {
      throw new IllegalArgumentException();
  }
  
  
  public String getApp(){
      return app;
  }
  }
  
  public class Util {
  
  public static TestObject getObject() {
      // TODO Auto-generated method stub
      return null;
  }
  
  public static String getAppName() {
      // TODO Auto-generated method stub
      return null;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>But while asserting for getAppName, it is failing. In the above code, I am able to mock super class constructor but unable to mock Util.getAppName().</p>
  
  <p>I am new to JMockit, hence would appreciate help.</p>