@Test
public void testExecuteEnd() throws Exception {

    processor.status = status;
    processor.infos = Arrays.asList(info);
    Mockito.when(action.isRelevant(ctx, info)).thenReturn(true);
    Mockito.when(ctx.getPhase()).thenReturn(Phase.END);
    Mockito.when(info.getActions()).thenReturn(Collections.singletonMap(Phase.END, Arrays.asList(action)));
    JcrUtils.getOrCreateByPath("/test", JcrConstants.NT_UNSTRUCTURED, ctx.getSession());
    Assert.assertTrue("Make sure the session has changed to verify save after execution.",
            ctx.getSession().hasPendingChanges());
    processor.execute(ctx);
    Assert.assertFalse(ctx.getSession().hasPendingChanges());
    Mockito.verify(info).executed(action);
    Mockito.verify(action).execute(ctx);
    Mockito.verify(status).update(ctx, false);
    Mockito.verify(status).update(ctx, info);
}