@Test
public void step_callbacks_should_be_invoked_when_steps_are_executed() {
final MByHave8Hooks hooks = Mockito.mock(MByHave8Hooks.class);
final InOrder inOrder = Mockito.inOrder(hooks);
final MByHaveSpec spec = new MByHaveSpec() {{
Feature("Test Feature1",
Scenario("Scenario1",
given("initial state", () -> {}),
when("something happens", () -> {}),
then("we get this state", () -> {})
)
);
}};
spec.registerHooks(hooks);
spec.execute();
final ArgumentCaptor<Feature> featureCaptor = ArgumentCaptor.forClass(Feature.class);
inOrder.verify(hooks).startFeature(featureCaptor.capture());
assertNotNull(featureCaptor.getValue());