org.mockito.runners.MockitoJUnit44Runner Maven / Gradle / Ivy
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.runners;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import java.lang.reflect.InvocationTargetException;
/**
* Deprecated: Simply use {@link MockitoJUnitRunner}
*
* Compatible only with JUnit 4.4, this runner adds following behavior:
*
* -
* Initializes mocks annotated with {@link Mock},
* so that explicit usage of {@link MockitoAnnotations#initMocks(Object)} is not necessary.
* Mocks are initialized before each test method.
*
-
* validates framework usage after each test method. See javadoc for {@link Mockito#validateMockitoUsage()}.
*
*
* Runner is completely optional - there are other ways you can get @Mock working, for example by writing a base class.
* Explicitly validating framework usage is also optional because it is triggered automatically by Mockito every time you use the framework.
* See javadoc for {@link Mockito#validateMockitoUsage()}.
*
* Read more about @Mock annotation in javadoc for {@link MockitoAnnotations}
*
* Example:
*
* @RunWith(MockitoJUnit44Runner.class)
* public class ExampleTest {
*
* @Mock
* private List list;
*
* @Test
* public void shouldDoSomething() {
* list.add(100);
* }
* }
*
*
*
*/
@Deprecated
public class MockitoJUnit44Runner extends MockitoJUnitRunner {
public MockitoJUnit44Runner(Class> klass) throws InvocationTargetException {
super(klass);
}
}