@@ -63,8 +63,8 @@ class StateMachineTest {
6363 .connect(' b' , ' c' , Event .E3 )
6464 .build()
6565
66- assertEquals(Accepted (' b' ), fsm.onEvent(' a' , Event .E2 ) { n + = 2 })
67- assertEquals(Accepted (' c' ), fsm.onEvent(' b' , Event .E3 ) { n + = 3 })
66+ assertEquals(Accepted (' b' ), fsm.onEvent(' a' , Event .E2 ).onTransition { n + = 2 })
67+ assertEquals(Accepted (' c' ), fsm.onEvent(' b' , Event .E3 ).onTransition { n + = 3 })
6868
6969 assertEquals(5 , n)
7070 }
@@ -140,7 +140,7 @@ class StateMachineTest {
140140 .connect(State .S1 , State .S2 , Event .E1 )
141141 .build()
142142
143- fsm.onEvent(State .S1 , Event .E1 ){
143+ fsm.onEvent(State .S1 , Event .E1 ).onTransition {
144144 semaphore.tryAcquire(4 )
145145 }
146146
@@ -168,7 +168,7 @@ class StateMachineTest {
168168 .connect(State .S1 , State .S2 , Event .E1 )
169169 .build()
170170
171- fsm.onEvent(State .S1 , Event .E1 , ::toggle)
171+ fsm.onEvent(State .S1 , Event .E1 ).onTransition( ::toggle)
172172 assertTrue(executed)
173173 }
174174
@@ -184,7 +184,7 @@ class StateMachineTest {
184184 .connect(State .S1 , State .S2 , Event .E1 )
185185 .build()
186186
187- fsm.onEvent(State .S1 , Event .E1 ) { toggle() }
187+ fsm.onEvent(State .S1 , Event .E1 ).onTransition { toggle() }
188188 assertTrue(executed)
189189 }
190190
@@ -277,7 +277,7 @@ class StateMachineTest {
277277 .connect(State .S1 , State .S2 , Event .E1 )
278278 .build()
279279
280- fsm.onEvent(State .S1 , Event .E1 ) { throw exception }
280+ fsm.onEvent(State .S1 , Event .E1 ).onTransition { throw exception }
281281 }
282282}
283283
0 commit comments