SyncAsyncExtension Class
- java.
lang. Object - com.
azure. core. test. SyncAsyncExtension
- com.
Implements
public final class SyncAsyncExtension
implements org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider
A test template extension that helps to branch out a single test into sync and async invocation.
Constructor Summary
| Constructor | Description |
|---|---|
| SyncAsyncExtension() |
Creates a new instance of SyncAsyncExtension. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| static T |
execute(Callable<T> sync, Callable<Mono<T>> async)
Executes sync or async branch depending on the context. |
| static void |
execute(Runnable sync, Callable<Mono<Void>> async)
Executes sync or async branch depending on the context. |
| Stream<org.junit.jupiter.api.extension.TestTemplateInvocationContext> | provideTestTemplateInvocationContexts(ExtensionContext extensionContext) |
| boolean | supportsTestTemplate(ExtensionContext extensionContext) |
Methods inherited from java.lang.Object
Constructor Details
SyncAsyncExtension
public SyncAsyncExtension()
Creates a new instance of SyncAsyncExtension.
Method Details
execute
public static T <T>execute(Callable<T> sync, Callable<Mono<T>> async)
Executes sync or async branch depending on the context.
Parameters:
Returns:
execute
public static void execute(Runnable sync, Callable<Mono<Void>> async)
Executes sync or async branch depending on the context.
Parameters:
provideTestTemplateInvocationContexts
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext extensionContext)
Parameters:
supportsTestTemplate
public boolean supportsTestTemplate(ExtensionContext extensionContext)
Parameters: