CdiProducerDecorator implements TestMethodDecorator { @Override public void beforeTest(final TestInvocation invocation) throws Exception { final EntityManager em = (EntityManager) invocation.getContext().getData(Constants.KEY_ENTITY_MANAGER); emh.setEntityManager(em); } CdiProducerDecorator(); @Override int getPriority(); @Override void beforeTest(final TestInvocation invocation); @Override void afterTest(final TestInvocation invocation); @Override boolean isConfigurationSupported(final ExecutionContext ctx);  }
@Test public void testBeforeInstance() throws Exception { fixture.beforeTest(invocation); verify(emh).setEntityManager(eq(em)); verifyNoMoreInteractions(emh, em); }