title: NoSuchMethodError: org.mockito.internal.runners.RunnerFactory.createStrict
body: <p>I am using latest versions of <code>JUnitParams</code>, <code>junit</code> and <code>mockito-all</code>. </p>
  
  <pre><code>testCompile group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
  testCompile group: 'junit', name: 'junit', version: '4.12'
  testCompile group: 'org.mockito', name: 'mockito-all', version: '2.0.2-beta'
  </code></pre>
  
  <p>I keep getting <code>NoSuchMethodError</code> when running a JUnit test with annotation <code>@RunWith(MockitoJUnitRunner.class)</code>.</p>
  
  <pre><code>java.lang.NoSuchMethodError: org.mockito.internal.runners.RunnerFactory.createStrict(Ljava/lang/Class;)Lorg/mockito/internal/runners/InternalRunner;
  
      at org.mockito.junit.MockitoJUnitRunner.&lt;init&gt;(MockitoJUnitRunner.java:154)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
      at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
      at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
  </code></pre>
  
  <p>What can be the problem that triggers <code>NoSuchMethodError</code> exception?</p>
  
  <p>Code:</p>
  
  <pre><code>@RunWith(MockitoJUnitRunner.class)
  public class MockTest {
  
      @Mock
      ServletUriComponentsBuilder servletUriComponentsBuilder;
  
      @Before
      public void setup() {
          servletUriComponentsBuilder = mock(ServletUriComponentsBuilder.class);
      }
  
      @Test
      public void shouldGenerateUrl() {
          when(servletUriComponentsBuilder.fromUriString(anyString()).build().toString())
                  .thenReturn("test");
  
          Assert.assertEquals("my message", "test", "test");
      }
  
  }
  </code></pre>