14.6. Testing flow event handling
Prev | 14. Testing flows | Next

## 14.6. Testing flow event handling

Define additional tests to exercise flow event handling behavior. You goal should be to exercise all paths through the flow. You can use the convenient `setCurrentState(String)` method to jump to the flow state where you wish to begin your test.

    public void testEnterBookingDetails_Proceed() {

        setCurrentState("enterBookingDetails");

        getFlowScope().put("booking", createTestBooking());

        MockExternalContext context = new MockExternalContext();
        context.setEventId("proceed");
        resumeFlow(context);

        assertCurrentStateEquals("reviewBooking");
    }

Prev | Up | Next
14.5. Testing flow startup | Home | 14.7. Mocking a subflow