GH-185 - Allow verification of events after method invocation stimulus.

This commit is contained in:
Oliver Drotbohm
2023-04-24 17:31:21 +02:00
parent b834c255ec
commit 3a923519f2
2 changed files with 26 additions and 0 deletions

View File

@@ -382,6 +382,20 @@ class ScenarioUnitTests {
assertThat(specialCustomizer.invoked).isFalse();
}
@Test // GH-185
@SuppressWarnings("unchecked")
void invokesEventVerificationOnMethodInvocationStimulus() {
Consumer<AssertablePublishedEvents> consumer = mock(Consumer.class);
new Scenario(tx, publisher, new DefaultAssertablePublishedEvents())
.stimulate(() -> {})
.andWaitForStateChange(() -> true)
.andVerifyEvents(consumer);
verify(consumer).accept(any());
}
private Fixture givenAScenario(Consumer<Scenario> consumer) {
return new Fixture(consumer, DELAY, null, new DefaultAssertablePublishedEvents());
}