use of org.junit.platform.launcher.core.CompositeTestExecutionListener.EagerTestExecutionListener in project junit5 by junit-team.
the class CompositeTestExecutionListenerTests method shouldThrowOutOfMemoryExceptionAndStopEagerListenerWithoutLog.
@Test
void shouldThrowOutOfMemoryExceptionAndStopEagerListenerWithoutLog(LogRecordListener logRecordListener) {
listeners.add(new EagerTestExecutionListener() {
@Override
public void executionJustStarted(TestIdentifier testIdentifier) {
throw new OutOfMemoryError();
}
});
var testIdentifier = getSampleMethodTestIdentifier();
assertThatThrownBy(() -> compositeTestExecutionListener().executionStarted(testIdentifier)).isInstanceOf(OutOfMemoryError.class);
assertNotLogs(logRecordListener);
}
Aggregations