TestBean bean = new TestBean(1, "Keith Donald");
EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory);
em.persist(bean);
assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
EndState endState = new EndState(flowSession.getDefinitionInternal(), "success");
endState.getAttributes().put("commit", true);
flowSession.setState(endState);
jpaListener.sessionEnding(context, flowSession, "success", null);
jpaListener.sessionEnded(context, flowSession, "success", null);
assertEquals("Table should only have two rows", 2, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));