use of io.cucumber.core.stepexpression.StepTypeRegistry in project cucumber-jvm by cucumber.
the class CachingGlueTest method emits_hook_messages_to_bus.
@Test
public void emits_hook_messages_to_bus() {
List<Envelope> events = new ArrayList<>();
EventHandler<Envelope> messageEventHandler = e -> events.add(e);
EventBus bus = new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID);
bus.registerHandlerFor(Envelope.class, messageEventHandler);
CachingGlue glue = new CachingGlue(bus);
glue.addBeforeHook(new MockedScenarioScopedHookDefinition());
glue.addAfterHook(new MockedScenarioScopedHookDefinition());
glue.addBeforeStepHook(new MockedScenarioScopedHookDefinition());
glue.addAfterStepHook(new MockedScenarioScopedHookDefinition());
glue.prepareGlue(stepTypeRegistry);
assertThat(events.size(), is(4));
}
Aggregations