@Test
public void testAfterAll() throws Throwable {

    // GIVEN
    when(ctx.getData(Constants.KEY_ENTITY_MANAGER_FACTORY)).thenReturn(factory);
    final EntityManagerFactoryDecorator decorator = new EntityManagerFactoryDecorator();
    // WHEN
    decorator.afterAll(invocation);
    // THEN
    verify(ctx).storeData(eq(Constants.KEY_ENTITY_MANAGER_FACTORY), eq(null));
    verify(factory).close();
}