title: Spring MVC Unit Test issue with powermock dependecy
body: <p>Hi I have the following code to test:</p>
  
  <pre><code> @RequestMapping(value = "/displayPages", method = RequestMethod.GET)
      public ModelAndView errorPage(ModelMap model, HttpServletRequest request) {
          String token = (request != null) ? request.getParameter("tok") : "";
          boolean requestP = ESAPI.validator().isValidInput("Request Param", tok, "HTTPParameterValue", 1, false);
          if (requestP || token.contains(msg.getMessage("techErr.tok", new Object[]{}, Constants.LOCAL))) {
              return new ModelAndView("dispError");
          } else {
              return new ModelAndView("login");
          }
  
      }
  </code></pre>
  
  <p>Please find my unit test below:</p>
  
  <pre><code>import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.mockito.Matchers;
  import static org.mockito.Mockito.when;
  import org.owasp.esapi.ESAPI;
  import org.powermock.api.mockito.PowerMockito;
  import org.powermock.core.classloader.annotations.PrepareForTest;
  import org.powermock.modules.junit4.PowerMockRunner;
  import org.springframework.test.web.servlet.MockMvc;
  import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
  import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
  
  
  
  @RunWith(PowerMockRunner.class)
  @PrepareForTest({ESAPI.class})
  public class StaticClass {
  
        private MockMvc mockMvc;
  
      @Test
      public void testErrorPage() throws Exception {
          System.out.println("initialize");
          PowerMockito.mockStatic(ESAPI.class);
          when(ESAPI.validator().isValidInput(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(),  Matchers.anyInt(), Matchers.anyBoolean())).thenReturn(true);
  
           mockMvc.perform(get("/displayPages"))
                  .andExpect(view().name("dispError")
  
                  );
      }
  
  }
  </code></pre>
  
  <p>I am trying to mock the static method method  ESAPI.validator().isValidInput and this is why i am using powermock.</p>
  
  <p>When I execute the above code the following error is displayed:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/powermock/tests/utils/RunnerTestSuiteChunker
  Caused by: java.lang.ClassNotFoundException: org.powermock.tests.utils.RunnerTestSuiteChunker
  </code></pre>
  
  <p>Please find below my maven dependency:</p>
  
  <pre><code>    &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.12-beta-2&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-mockito&lt;/artifactId&gt;
              &lt;version&gt;1.6.4&lt;/version&gt;
         &lt;/dependency&gt;
  
     &lt;dependency&gt;
      &lt;groupId&gt;org.mockito&lt;/groupId&gt;
      &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
      &lt;version&gt;1.10.19&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.6.5&lt;/version&gt;
           &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;3.2.5.RELEASE&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt; 
  </code></pre>
  
  <p>Any idea why I am getting org.powermock.tests.utils.RunnerTestSuiteChunker  as the jar powermock is already in the classpath?</p>
  
  <p>Please note that when I use mockito on its own it works fine but because of the static method I have to add powermock.</p>
  
  <p>Thanks in advance for any advice</p>