test updated

This commit is contained in:
Vyacheslav Boyko 2022-07-12 17:42:07 +03:00
parent 35285b61bf
commit 9fb2276ac1

View File

@ -92,6 +92,8 @@ public class FsmTest {
.withAfterHandler(fsm -> initAfter.set(true)) .withAfterHandler(fsm -> initAfter.set(true))
.withProcessor((fsm, event) -> initProcess.set(true)) .withProcessor((fsm, event) -> initProcess.set(true))
.end() .end()
.state("intermediate")
.end()
.finish("finish") .finish("finish")
.withBeforeHandler(fsm -> finishBefore.set(true)) .withBeforeHandler(fsm -> finishBefore.set(true))
.withAfterHandler(fsm -> finishAfter.set(true)) .withAfterHandler(fsm -> finishAfter.set(true))
@ -99,6 +101,11 @@ public class FsmTest {
.end() .end()
.withTransition() .withTransition()
.from("init") .from("init")
.to("intermediate")
.checking((fsm, event) -> true)
.end()
.withTransition()
.from("intermediate")
.to("finish") .to("finish")
.checking((fsm, event) -> true) .checking((fsm, event) -> true)
.end() .end()
@ -107,9 +114,10 @@ public class FsmTest {
// @formatter:on // @formatter:on
simpleFsm.process("");
simpleFsm.process(""); simpleFsm.process("");
//Assert.assertEquals("finish", simpleFsm.getCurrentState().getName()); Assert.assertEquals("finish", simpleFsm.getCurrentState().getName());
Assert.assertTrue(initBefore.get()); Assert.assertTrue(initBefore.get());
Assert.assertTrue(initProcess.get()); Assert.assertTrue(initProcess.get());
Assert.assertTrue(initAfter.get()); Assert.assertTrue(initAfter.get());