Interface MockitoRule

All Superinterfaces:
org.junit.rules.MethodRule
All Known Implementing Classes:
MockitoJUnitRule

public interface MockitoRule extends org.junit.rules.MethodRule
The JUnit rule can be used instead of MockitoJUnitRunner. It requires JUnit at least 4.7. This rule adds following behavior: Example use:

 public class ExampleTest {

     @Rule
     public MockitoRule rule = MockitoJUnit.rule();

     @Mock
     private List list;

     @Test
     public void shouldDoSomething() {
         list.add(100);
     }
 }
 
Since:
1.10.17
  • Method Summary

    Methods inherited from interface org.junit.rules.MethodRule

    apply