title: Cannot find Java package powermock.api.mockito
body: <p>I am trying to get Power Mockito to work in my java test. For the life of me I cannot get it to find it. I tried inserting the dependency in the pom file, rebuild project and run the tests, but it still will not find it. Any ideas why it will not find this?</p>
  
  <p>Here's what I have in my <code>MemberServiceTest.java</code> file:</p>
  
  <pre><code>package com.cerner.revenuecycle.vbr.services;
  
  import static org.junit.Assert.assertEquals;
  
  import java.util.ArrayList;
  import java.util.HashSet;
  import java.util.List;
  
  import org.junit.Before;
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.hibernate.SessionFactory;
  import org.mockito.InjectMocks;
  import org.mockito.Mock;
  import org.mockito.Mockito;
  import org.mockito.runners.MockitoJUnitRunner;
  import org.junit.runner.RunWith;
  import org.mockito.InjectMocks;
  import org.powermock.api.mockito.PowerMockito; //***** cant find *****
  import org.powermock.core.classloader.annotations.PrepareForTest; //**** cant find ****
  import org.powermock.modules.junit4.PowerMockRunner; //***** cant find ****
  
  @RunWith(MockitoJUnitRunner.class)
  public class MemberServiceTest {
  
      @InjectMocks
      MemberService memberService;
  
      @Mock
      MemberHibernate memberHibernate;
  
      @Mock
      CaseHelper caseHelper;
  
      @Test
      public void testGetCaseNumber() {
  
          SessionFactory testSessionFactory = HibernateUtil.newTestSessionFactory();
          PowerMockito.mockStatic(HibernateUtil.class); //this doesnt work now
  
  
          PowerMockito.when(HibernateUtil.getSessionFactory()).thenReturn(testSessionFactory); //this doesnt work now 
          Case case1 = new Case();
          Case case2 = new Case();
          case1.setTenantId("1");
          case2.setTenantId("2");
  
          String caseNum1 = caseHelper.getNextCaseNumberFromDatabase(case1.getTenantId());
          String caseNum2 = caseHelper.getNextCaseNumberFromDatabase(case2.getTenantId());
  
          assertEquals(caseNum1, caseNum2);
  
      }
  }
  </code></pre>
  
  <p>and in my <code>pom.xml</code> file, as you can see I've put the mockito and powermock dependencies in there:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.cerner.revenuecycle.vbr&lt;/groupId&gt;
      &lt;artifactId&gt;vbr-services-integration&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.cerner.revenuecycle.vbr&lt;/groupId&gt;
          &lt;artifactId&gt;vbr-services-parent&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;name&gt;vbr-services-integration&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.test-framework.providers&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-test-framework-provider-jetty&lt;/artifactId&gt;
              &lt;version&gt;2.17&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-media-json-jackson&lt;/artifactId&gt;
              &lt;version&gt;2.17&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
              &lt;version&gt;1.9.5&lt;/version&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.5.6&lt;/version&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.5.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
              &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.skyscreamer&lt;/groupId&gt;
              &lt;artifactId&gt;jsonassert&lt;/artifactId&gt;
              &lt;version&gt;1.2.3&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.12.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;skipTests&gt;true&lt;/skipTests&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.6&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;integration-test&lt;/goal&gt;
                              &lt;goal&gt;verify&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.6&lt;/version&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;
                          &lt;artifactId&gt;wagon-ssh&lt;/artifactId&gt;
                          &lt;version&gt;1.0-beta-7&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;
                          &lt;artifactId&gt;wagon-webdav-jackrabbit&lt;/artifactId&gt;
                          &lt;version&gt;1.0&lt;/version&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Any idea why it is not finding the library for powermockito?</p>