@Test public void shouldValidateWithDefaultRunner() throws Exception { //given runner = new MockitoJUnitRunner(DummyTest.class); //when runner.run(notifier); //then assertThat(notifier.addedListeners, contains(clazz(FrameworkUsageValidator.class))); }
@Test public void shouldValidateWithD44Runner() throws Exception { //given runner = new MockitoJUnit44Runner(DummyTest.class); //when runner.run(notifier); //then assertThat(notifier.addedListeners, contains(clazz(FrameworkUsageValidator.class))); }
@Test public void shouldValidateWithVerboseRunner() throws Exception { //given runner = new ConsoleSpammingMockitoJUnitRunner(DummyTest.class); //when runner.run(notifier); //then assertEquals(2, notifier.addedListeners.size()); assertThat(notifier.addedListeners, contains(clazz(FrameworkUsageValidator.class))); }
@Override public void run(final RunNotifier notifier) { // add listener that validates Mockito mocks at the end of each test notifier.addListener(new FrameworkUsageValidator(notifier)); super.run(notifier); }
public void run(final RunNotifier notifier) { // add listener that validates framework usage at the end of each test notifier.addListener(new FrameworkUsageValidator(notifier)); runner.run(notifier); }
public void run(RunNotifier notifier) { // add listener that validates framework usage at the end of each test notifier.addListener(new FrameworkUsageValidator(notifier)); runner.run(notifier); }