title: mockito + easymock - NoClassDefFoundError:net/sf/cglib/proxy/Enhancer
body: <p>I am writing a test using easymock + powermock, the reason I am using powermock is to mock a static method.</p>
  
  <p>my test class looks like:</p>
  
  <pre><code>import static org.powermock.api.easymock.PowerMock.mockStatic;
  
  import org.junit.Assert;
  import org.junit.Test;
  import org.junit.runner.RunWith;
  
  import org.mockito.Mockito;
  import org.powermock.core.classloader.annotations.PrepareForTest;
  import org.powermock.modules.junit4.PowerMockRunner;
  
  @RunWith(PowerMockRunner.class)
  @PrepareForTest(StaticTest.class)
  public class DummyTest {
      @Test
      public void testDummy() {
          mockStatic(StaticTest.class);
          Mockito.when(StaticTest.testMethod()).thenReturn("hello world");
          ........
  }
  </code></pre>
  
  <p>here is my test dependencies and versions:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.10&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.powermock&lt;/groupId&gt;
          &lt;artifactId&gt;powermock-module-junit4&lt;/artifactId&gt;
          &lt;version&gt;1.4.12&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.powermock&lt;/groupId&gt;
          &lt;artifactId&gt;powermock-api-easymock&lt;/artifactId&gt;
          &lt;version&gt;1.4.12&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Running the test, I got initializationError as below:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer
  at org.powermock.api.extension.proxyframework.ProxyFrameworkImpl.isProxy(ProxyFrameworkImpl.java:29)
  at org.powermock.reflect.internal.WhiteboxImpl.getUnmockedType(WhiteboxImpl.java:1783)
  at org.powermock.reflect.internal.WhiteboxImpl.getType(WhiteboxImpl.java:2237)
  at org.powermock.reflect.internal.WhiteboxImpl.setInternalState(WhiteboxImpl.java:327)
  at org.powermock.reflect.proxyframework.RegisterProxyFramework.registerProxyFramework(RegisterProxyFramework.java:18)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.powermock.reflect.internal.WhiteboxImpl.performMethodInvocation(WhiteboxImpl.java:2014)
  at org.powermock.reflect.internal.WhiteboxImpl.doInvokeMethod(WhiteboxImpl.java:885)
  at org.powermock.reflect.internal.WhiteboxImpl.invokeMethod(WhiteboxImpl.java:859)
  at org.powermock.reflect.Whitebox.invokeMethod(Whitebox.java:466)
  at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.registerProxyframework(AbstractTestSuiteChunkerImpl.java:154)
  at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.getPowerMockTestListenersLoadedByASpecificClassLoader(AbstractTestSuiteChunkerImpl.java:107)
  at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:144)
  at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:39)
  at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.createTestDelegators(AbstractTestSuiteChunkerImpl.java:217)
  at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.&lt;init&gt;(JUnit4TestSuiteChunkerImpl.java:59)
  at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.&lt;init&gt;(AbstractCommonPowerMockRunner.java:32)
  at org.powermock.modules.junit4.PowerMockRunner.&lt;init&gt;(PowerMockRunner.java:31)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
  at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
  at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
  at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.&lt;init&gt;(JUnit4TestReference.java:33)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.&lt;init&gt;(JUnit4TestClassReference.java:25)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  
  Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Enhancer
  at java.net.URLClassLoader$1.run(Unknown Source)
  at java.net.URLClassLoader$1.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:143)
  at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  ... 39 more
  </code></pre>
  
  <p>has anybody run into this issue before?</p>