use of org.junit.platform.engine.TestExecutionResult in project mockito by mockito.
the class StrictnessTest method session_does_not_check_for_strict_stubs_on_test_failure.
@Test
void session_does_not_check_for_strict_stubs_on_test_failure() {
TestExecutionResult result = invokeTestClassAndRetrieveMethodResult(StrictStubsNotReportedOnTestFailure.class);
assertThat(result.getStatus()).isEqualTo(TestExecutionResult.Status.FAILED);
Throwable throwable = result.getThrowable().get();
assertThat(throwable).isInstanceOf(MyAssertionError.class);
assertThat(throwable.getSuppressed()).isEmpty();
}
use of org.junit.platform.engine.TestExecutionResult in project mockito by mockito.
the class StrictnessTest method inherits_strictness_from_base_class.
@Test
void inherits_strictness_from_base_class() {
TestExecutionResult result = invokeTestClassAndRetrieveMethodResult(InheritedWarnStubs.class);
assertThat(result.getStatus()).isEqualTo(TestExecutionResult.Status.SUCCESSFUL);
}
use of org.junit.platform.engine.TestExecutionResult in project neo4j by neo4j.
the class ProfilerExtensionTest method profilingExtensionMustNotBreakOnUninitialisedTestDirectory.
@Test
void profilingExtensionMustNotBreakOnUninitialisedTestDirectory() {
// Because this test *aborts* rather than fails or completes normally, we will be in a state where we both have an
// execution exception *and* the TestDirectoryExtension cleans up after itself as if the test was a success.
// In this case, the profiler extension will see an uninitialised TestDirectoryExtension, and must be able to cope
// with that. Furthermore, these particular tests are arranged such that the TestDirectoryExtension has its
// lifecycle nested within the ProfilerExtension, which means that the test directory will do its cleanup
// before the profiler extension gets to write its results.
CONTEXT.clear();
execute(ProfiledTemplateVerification.class, "testThatFailsBeforeInitialisingTestDirectory", new TestExecutionListener() {
@Override
public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) {
// Notably, we should not see any FAILED results.
assertThat(testExecutionResult.getStatus()).isIn(SUCCESSFUL, ABORTED);
}
});
}
Aggregations