14.5. Testing flow startup
Prev | 14. Testing flows | Next

## 14.5. Testing flow startup

Have your first test exercise the startup of your flow:

    public void testStartBookingFlow() {

        Booking booking = createTestBooking();

        MutableAttributeMap input = new LocalAttributeMap();
        input.put("hotelId", "1");
        MockExternalContext context = new MockExternalContext();
        context.setCurrentUser("keith");
        startFlow(input, context);

        assertCurrentStateEquals("enterBookingDetails");
        assertTrue(getRequiredFlowAttribute("booking") instanceof Booking);
    }

Assertions generally verify the flow is in the correct state you expect.

Prev | Up | Next
14.4. Registering flow dependencies | Home | 14.6. Testing flow event handling