use of gherkin.formatter.model.Match in project cucumber-jvm by cucumber.
the class JUnitReporterTest method failed_step_and_after_with_pending_exception_non_strict.
@Test
public void failed_step_and_after_with_pending_exception_non_strict() {
createNonStrictReporter();
createDefaultRunNotifier();
Result stepResult = mock(Result.class);
Throwable exception = mock(Throwable.class);
when(stepResult.getError()).thenReturn(exception);
Result hookResult = mock(Result.class);
Match match = mock(Match.class);
when(hookResult.getStatus()).thenReturn("Pending");
when(hookResult.getError()).thenReturn(new PendingException());
EachTestNotifier executionUnitNotifier = mock(EachTestNotifier.class);
jUnitReporter.executionUnitNotifier = executionUnitNotifier;
jUnitReporter.result(stepResult);
jUnitReporter.after(match, hookResult);
jUnitReporter.finishExecutionUnit();
verify(executionUnitNotifier, times(0)).fireTestIgnored();
}
use of gherkin.formatter.model.Match in project cucumber-jvm by cucumber.
the class FeatureResultListenerTest method should_forward_calls_to_reporter_interface_methods.
@Test
public void should_forward_calls_to_reporter_interface_methods() throws Exception {
Match match = mock(Match.class);
Result result = mockPassedResult();
String mimeType = "mimeType";
byte[] data = new byte[] { 1 };
String text = "text";
Reporter reporter = mock(Reporter.class);
FeatureResultListener resultListener = new FeatureResultListener(reporter, false);
resultListener.before(match, result);
resultListener.match(match);
resultListener.embedding(mimeType, data);
resultListener.write(text);
resultListener.result(result);
resultListener.after(match, result);
verify(reporter).before(match, result);
verify(reporter).match(match);
verify(reporter).embedding(mimeType, data);
verify(reporter).write(text);
verify(reporter).result(result);
verify(reporter).after(match, result);
}
Aggregations