@Test public void cannotFulfill() throws Throwable { when(requirements.canFulfill()).thenReturn(false); Runner runner = runnerBuilder.runnerForClass(TestCase.class); assertNull(runner); }
@Test public void canFulfill() throws Throwable { when(requirements.canFulfill()).thenReturn(true); Runner runner = runnerBuilder.runnerForClass(TestCase.class); assertNotNull(runner); assertThat(runner, is(RequirementsRunner.class)); }
/* (non-Javadoc) * @see org.junit.runners.model.Statement#evaluate() */ @Override public void evaluate() throws Throwable { requirements.fulfill(); statement.evaluate(); }