title: JMockit with JUnit5 - JMockit didn't get initialized
body: <p>When I am using the following Test method using JUnit 5 and JMockit, I am getting an error as:</p>
  
  <p><strong>JMockit didn't get initialized; please check the -javaagent JVM initialization parameter was used</strong></p>
  
  <p>These are my classes which I created and want to test:</p>
  
  <pre><code>    import java.util.ArrayList;
      import java.util.Collections;
      import java.util.List;
  
      class Employee 
      {
          private Integer empId;
          private String empName;
  
          public Employee(Integer empId,String empName)
          {
              this.empId = empId;
              this.empName = empName;
          }
  
          public Integer getEmpId() {
              return empId;
          }
          public void setEmpId(Integer empId) {
              this.empId = empId;
          }
          public String getEmpName() {
              return empName;
          }
          public void setEmpName(String empName) {
             this.empName = empName;
          }
      }
      class EmployeeDAO
      {
          private static List&lt;Employee&gt; employeeList = new ArrayList&lt;Employee&gt;();
  
          static
          {
             Employee e1 = new Employee(1001, "John");
             Employee e2 = new Employee(1002, "Jack");
  
             Collections.addAll(employeeList, e1,e2);
          }
  
          public static List&lt;Employee&gt; getEmployeeList() {
             return employeeList;
          }
  
          public static void setEmployeeList(List&lt;Employee&gt; employeeList) {
             EmployeeDAO.employeeList = employeeList;
          }
      }
  
      class EmployeeService
      {
         public List&lt;Employee&gt; getEmployees()
         {
             List&lt;Employee&gt; empListFromDao = new ArrayList&lt;Employee&gt;();
             try
             {
                 empListFromDao = EmployeeDAO.getEmployeeList();
             }
             catch(Exception e)
             {
                throw e;
             }
             return empListFromDao;
         }
      }
  </code></pre>
  
  <p>And this is my Test Implementation:</p>
  
  <pre><code>import org.junit.jupiter.api.Assertions;
  import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.extension.ExtendWith;
  
  import mockit.Mock;
  import mockit.MockUp;
  import mockit.integration.junit5.JMockitExtension;
  import static org.junit.jupiter.api.Assertions.assertEquals;
  
  @ExtendWith(JMockitExtension.class)
  public class EmployeeTest
  {
        @Test
        public void testMethodForStaticMock$FromService()
        {
            new MockUp&lt;EmployeeDAO&gt;()
        {
            @Mock
            public List&lt;Employee&gt; getEmployeeList()
            {
                return new ArrayList&lt;Employee&gt;();
            }
        };
  
            EmployeeService service = new EmployeeService();
            assertEquals(0,service.getEmployees().size());
        }
  }
  </code></pre>
  
  <p>Project Stack I have used:</p>
  
  <ul>
  <li>JDK 11.0.1</li>
  <li>Eclipse IDE 2020-03</li>
  <li>JUnit 5 (Added as library in Eclipse to project's classpath)</li>
  <li>JMockit 1.49 (Added as JAR)</li>
  </ul>
  
  <p>Due to the above mentioned problem my test case is not passing. 
  Any suggestions on how to resolve this issue? Or is there any other way to mock a static method?</p>