From 9fb2276ac14c64e0eeda0bbcce1fd97e8c3f29c8 Mon Sep 17 00:00:00 2001 From: Vyacheslav Boyko Date: Tue, 12 Jul 2022 17:42:07 +0300 Subject: [PATCH] test updated --- src/test/java/me/bvn13/fsm/tests/FsmTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/java/me/bvn13/fsm/tests/FsmTest.java b/src/test/java/me/bvn13/fsm/tests/FsmTest.java index 38a3140..ea75140 100644 --- a/src/test/java/me/bvn13/fsm/tests/FsmTest.java +++ b/src/test/java/me/bvn13/fsm/tests/FsmTest.java @@ -92,6 +92,8 @@ public class FsmTest { .withAfterHandler(fsm -> initAfter.set(true)) .withProcessor((fsm, event) -> initProcess.set(true)) .end() + .state("intermediate") + .end() .finish("finish") .withBeforeHandler(fsm -> finishBefore.set(true)) .withAfterHandler(fsm -> finishAfter.set(true)) @@ -99,6 +101,11 @@ public class FsmTest { .end() .withTransition() .from("init") + .to("intermediate") + .checking((fsm, event) -> true) + .end() + .withTransition() + .from("intermediate") .to("finish") .checking((fsm, event) -> true) .end() @@ -107,9 +114,10 @@ public class FsmTest { // @formatter:on + simpleFsm.process(""); simpleFsm.process(""); - //Assert.assertEquals("finish", simpleFsm.getCurrentState().getName()); + Assert.assertEquals("finish", simpleFsm.getCurrentState().getName()); Assert.assertTrue(initBefore.get()); Assert.assertTrue(initProcess.get()); Assert.assertTrue(initAfter.get());