/** * Test method for {@link FlowExecutionException#FlowExecutionException(String, Throwable)}. */ @Test public void testFlowExecutionExceptionStringThrowable() { FlowExecutionException exception = new FlowExecutionException("foo", new RuntimeException("bar")); assertEquals("foo", exception.getMessage()); assertEquals("bar", exception.getCause().getMessage()); }
/** * Test method for {@link FlowExecutionException#FlowExecutionException(String)}. */ @Test public void testFlowExecutionExceptionString() { FlowExecutionException exception = new FlowExecutionException("foo"); assertEquals("foo", exception.getMessage()); }
@Test public void testNoMatchForNextStep() throws Exception { flow.setStateTransitions(collect(StateTransition.createStateTransition(new StubState("step1"), "FOO", "step2"), StateTransition.createEndStateTransition(new StubState("step2")))); flow.afterPropertiesSet(); try { flow.start(executor); fail("Expected JobExecutionException"); } catch (FlowExecutionException e) { // expected String message = e.getMessage(); assertTrue("Wrong message: " + message, message.toLowerCase().contains("next state not found")); } }