public final class TestLifecycleScopeProvider extends java.lang.Object implements LifecycleScopeProvider<TestLifecycleScopeProvider.TestLifecycle>
LifecycleScopeProvider instances for tests.
Supports a start and stop lifecycle. Subscribing when outside of the lifecycle will throw
either a LifecycleNotStartedException or LifecycleEndedException.
| Modifier and Type | Class and Description |
|---|---|
static class |
TestLifecycleScopeProvider.TestLifecycle |
| Modifier and Type | Method and Description |
|---|---|
CorrespondingEventsFunction<TestLifecycleScopeProvider.TestLifecycle> |
correspondingEvents() |
static TestLifecycleScopeProvider |
create() |
static TestLifecycleScopeProvider |
createInitial(TestLifecycleScopeProvider.TestLifecycle initialValue) |
<any> |
lifecycle() |
TestLifecycleScopeProvider.TestLifecycle |
peekLifecycle() |
CompletableSource |
requestScope() |
void |
start()
Start the test lifecycle.
|
void |
stop()
Stop the test lifecycle.
|
public static TestLifecycleScopeProvider create()
TestLifecycleScopeProvider instance.public static TestLifecycleScopeProvider createInitial(TestLifecycleScopeProvider.TestLifecycle initialValue)
initialValue - the initial lifecycle event to create the TestLifecycleScopeProvider with.TestLifecycleScopeProvider instance with as its
initial lifecycle
event.public <any> lifecycle()
lifecycle in interface LifecycleScopeProvider<TestLifecycleScopeProvider.TestLifecycle>public CorrespondingEventsFunction<TestLifecycleScopeProvider.TestLifecycle> correspondingEvents()
correspondingEvents in interface LifecycleScopeProvider<TestLifecycleScopeProvider.TestLifecycle>public TestLifecycleScopeProvider.TestLifecycle peekLifecycle()
peekLifecycle in interface LifecycleScopeProvider<TestLifecycleScopeProvider.TestLifecycle>null if none. Note that is null is
returned at subscribe-time, it will be used as a signal to throw a LifecycleNotStartedException.public CompletableSource requestScope()
public void start()
public void stop()