public void testSmokeBehaviorFlushEntityManager() throws Exception {
WebApplicationBasePage page = new WebApplicationBasePage(
mock(IPageMap.class), new PageParameters());
- EntityManager entityManager = mock(EntityManager.class);
+ final EntityManager entityManager = mock(EntityManager.class);
when(entityManager.isOpen()).thenReturn(true);
- PageBehavior behavior = new FlushEntityManagerBehavior(entityManager);
+ PageBehavior behavior = new FlushEntityManagerBehavior() {
+ public EntityManager getEntityManager() { return entityManager; }
+ };
page.addBehavior(behavior);
wicket.startPage(page);
wicket.assertRenderedPage(WebApplicationBasePage.class);