@@ -155,30 +155,6 @@ class StateMachineTest {
155155 assertEquals(32 , value)
156156 }
157157
158- @Test
159- fun `test exception in interceptor is caught and returned as failure` () {
160- val exception = IllegalArgumentException (" foo" )
161- val fsm = StateMachine .builder<State , Event , Int >()
162- .initial(State .S1 )
163- .connect(State .S1 , State .S2 , Event .E2 )
164- .intercept { _, _, _, _ -> throw exception }
165- .build()
166-
167- assertEquals(Failed (exception), fsm.onEvent(State .S1 , Event .E2 , 0 ))
168- }
169-
170- @Test
171- fun `test exception in post interceptor is caught and returned as failure` () {
172- val exception = IllegalArgumentException (" foo" )
173- val fsm = StateMachine .builder<State , Event , Int >()
174- .initial(State .S1 )
175- .connect(State .S1 , State .S2 , Event .E2 )
176- .postIntercept { _, _, _, _ -> throw exception }
177- .build()
178-
179- assertEquals(Failed (exception), fsm.onEvent(State .S1 , Event .E2 , 0 ))
180- }
181-
182158 @Test
183159 fun `test transition with Action` () {
184160 val semaphore = Semaphore (10 )
@@ -237,17 +213,6 @@ class StateMachineTest {
237213 assertEquals(Rejected , fsm.onEvent(State .S1 , Event .E3 , false ))
238214 }
239215
240- @Test
241- fun `test exception in action is caught` () {
242- val exception = IllegalArgumentException (" foo" )
243- val fsm = StateMachine .builder<State , Event , Boolean >()
244- .initial(State .S1 )
245- .connect(State .S1 , State .S2 , Event .E1 ) { throw exception }
246- .build()
247-
248- assertEquals(Failed (exception), fsm.onEvent(State .S1 , Event .E1 , false ))
249- }
250-
251216 @Test(expected = StackOverflowError ::class )
252217 fun `test throwable in action is not caught` () {
253218 val exception = StackOverflowError (" foo" )
0 commit comments