public class AutoDisposingExtension
extends java.lang.Object
implements org.junit.jupiter.api.extension.BeforeTestExecutionCallback, org.junit.jupiter.api.extension.AfterTestExecutionCallback
Extension
that exposes a way to automatically cleanup arbitrary
Disposable
instances after a test, in a fluent fashion.构造器和说明 |
---|
AutoDisposingExtension() |
限定符和类型 | 方法和说明 |
---|---|
void |
afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) |
<T extends Disposable> |
autoDispose(T disposable)
Register a
Disposable for automatic cleanup and return it for chaining. |
void |
beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) |
public void beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
beforeTestExecution
在接口中 org.junit.jupiter.api.extension.BeforeTestExecutionCallback
java.lang.Exception
public void afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
afterTestExecution
在接口中 org.junit.jupiter.api.extension.AfterTestExecutionCallback
java.lang.Exception
public <T extends Disposable> T autoDispose(T disposable)
Disposable
for automatic cleanup and return it for chaining.T
- the type of the resourcedisposable
- the resource to clean up at end of test