public class WatcherExtension extends Object implements org.junit.jupiter.api.extension.BeforeTestExecutionCallback, org.junit.jupiter.api.extension.AfterTestExecutionCallback
It produces output like so:
INFO: Starting test: [aTest] INFO: Completed test [aTest] in 21 ms.
Usage example:
@ExtendWith(WatcherExtension.class)
public class MyTest {
@Test
public void aTest() {
// ...
}
}
| Modifier and Type | Method and Description |
|---|---|
void |
afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
Log test method exit, using the start time stored by
beforeTestExecution(ExtensionContext) to calculate a duration. |
void |
beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
Log test method entry and store its start time in the
ExtensionContext.Store for use in afterTestExecution(ExtensionContext). |
public void beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
throws Exception
ExtensionContext.Store for use in afterTestExecution(ExtensionContext).beforeTestExecution in interface org.junit.jupiter.api.extension.BeforeTestExecutionCallbackextensionContext - the context in which the current test or container is being
executedExceptionpublic void afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
throws Exception
beforeTestExecution(ExtensionContext) to calculate a duration.afterTestExecution in interface org.junit.jupiter.api.extension.AfterTestExecutionCallbackextensionContext - the context in which the current test or container is being
executedExceptionCopyright © 2017. All rights reserved.