@AutoService(value=org.junit.jupiter.api.extension.Extension.class) public final class ErrorDecorator extends Object implements org.junit.jupiter.api.extension.TestExecutionExceptionHandler
Example output:
org.junit.ComparisonFailure: expected:<H[ello]!> but was:<H[i]!>
at org.junit.Assert.assertEquals(Assert.java:115)
at example.HelloTest.hello(HelloTest.java:16)
14 @Test
15 public void hello() {
-> 16 assertEquals("Hello!", greet());
17 }
...
Usage:
@ExtendWith(ErrorDecorator.class)
class BaseTest {}
class MyTest extends BaseTest {
@Test
void myTest() {
// ...
}
}
Alternatively, run your tests with
-Djunit.jupiter.extensions.autodetection.enabled=true
instead of using annotations.
| Constructor and Description |
|---|
ErrorDecorator() |
| Modifier and Type | Method and Description |
|---|---|
void |
handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context,
Throwable e) |
Copyright © 2018. All rights reserved.