@Test
public void testFind() throws Exception {

    Flow flow = createFlow("blah");
    flowRepository.persist(flow);
    Long id = flow.getIdentifier();
    testTransactionManager.commitTransaction();
    testTransactionManager.beginTransaction();
    try {
        flowRepository.find(0L);
        fail("found non-existing flow");
    } catch (FlowException e) {
        // expected
    }
    flow = flowRepository.find(id);
    assertEquals(CLEAN, flow.getStatus());
    assertEquals("blah", new String(flow.getPacket()));
    assertNotNull(flow.getPart("0.0", CLEAN));
    assertNotNull(flow.getPart("0.1", CLEAN));
}