@Test
public void doAction_successDeactivatedSubpage() throws PersistenceException, ReplicationException, AecuException {

    ReplicationStatus replicationStatus = mock(ReplicationStatus.class);
    when(replicationStatus.isDeactivated()).thenReturn(true);
    when(subPage.adaptTo(ReplicationStatus.class)).thenReturn(replicationStatus);
    this.action = new TreeActivatePageAction(true, context);
    String result = action.doAction(resource);
    assertTrue(result.contains("Replicated page tree"));
    assertTrue(result.contains("1 pages"));
    verify(replicator, times(1)).replicate(session, ReplicationActionType.ACTIVATE, PATH);
    verify(replicator, never()).replicate(session, ReplicationActionType.ACTIVATE, SUBPATH);
}