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");
}