Open vania-pooh opened 7 years ago
This test fails:
package ru.yandex.qatools.fsm.impl; import org.junit.Before; import org.junit.Test; import ru.yandex.qatools.fsm.FSMException; import ru.yandex.qatools.fsm.Yatomata; import ru.yandex.qatools.fsm.annotations.FSM; import ru.yandex.qatools.fsm.annotations.OnTransit; import ru.yandex.qatools.fsm.annotations.Transit; import ru.yandex.qatools.fsm.annotations.Transitions; import ru.yandex.qatools.fsm.beans.TestFailedState; import ru.yandex.qatools.fsm.beans.TestStartedState; import ru.yandex.qatools.fsm.beans.TestState; import ru.yandex.qatools.fsm.beans.UndefinedState; import static org.mockito.Mockito.*; public class TransitFromParentClassTest { @FSM(start = UndefinedState.class) @Transitions({ @Transit(from = TestState.class, to = TestFailedState.class, on = TestFailedState.class), }) public interface TransitFromBaseClassFSM { @OnTransit void onTestStarted(TestStartedState event); @OnTransit void onTestFailed(TestState state, TestFailedState event); } private TransitFromBaseClassFSM fsm; private Yatomata<TransitFromBaseClassFSM> engine; @Before public void init() throws FSMException { fsm = mock(TransitFromBaseClassFSM.class); engine = new YatomataImpl<>(TransitFromBaseClassFSM.class, fsm, new TestStartedState()); } @Test public void testEvents() { TestFailedState event = new TestFailedState(); engine.fire(event); verify(fsm, never()).onTestStarted(any(TestStartedState.class)); verify(fsm).onTestFailed(any(TestState.class), any(TestFailedState.class)); verifyNoMoreInteractions(fsm); } }
@smecsia ping.
This test fails: