### Question:
ReplicationStatusManagerImpl implements ReplicationStatusManager { public final void setReplicationStatus(final ResourceResolver resourceResolver, final String replicatedBy, final Calendar replicatedAt, final Status status, final String... paths) throws RepositoryException, PersistenceException { for (final String path : paths) { final Resource resource = resourceResolver.getResource(path); if (resource == null) { log.warn("Requesting a replication status update for a resource that does not exist: {}", path); continue; } this.setReplicationStatus(resourceResolver, replicatedBy, replicatedAt, status, resource); } }  @Override Resource getReplicationStatusResource(String path, ResourceResolver resourceResolver); final void setReplicationStatus(final ResourceResolver resourceResolver,
                                           final String replicatedBy,
                                           final Calendar replicatedAt,
                                           final Status status,
                                           final String... paths); @SuppressWarnings("squid:S3776") final void setReplicationStatus(final ResourceResolver resourceResolver,
                                           final String replicatedBy,
                                           final Calendar replicatedAt,
                                           final Status status,
                                           final Resource... resources); final void clearReplicationStatus(final ResourceResolver resourceResolver,
                                       final Resource... resources); static final String DEFAULT_REPLICATED_BY; }### Answer:
@Test public void testSetReplicationStatus_Activate() throws Exception { final String replicationStatus = "Activate"; final String replicatedBy = "Test User"; final Calendar replicatedAt = Calendar.getInstance(); replicatedAt.set(1,1); replicationStatusManager.setReplicationStatus(resourceResolver, replicatedBy, replicatedAt, ReplicationStatusManager.Status.ACTIVATED, UNREPLICATED_PATH); assertTrue(unreplicatedNode.isNodeType(ReplicationStatus.NODE_TYPE)); assertSameTime(replicatedAt, unreplicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED).getDate()); assertEquals(replicatedBy, unreplicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED_BY).getString()); assertEquals(replicationStatus, unreplicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATION_ACTION).getString()); }
@Test public void testSetReplicationStatus_Deactivate_1() throws Exception { final String replicationStatus = "Deactivate"; final String replicatedBy = "Test User"; final Calendar replicatedAt = Calendar.getInstance(); replicatedAt.set(1,1); replicationStatusManager.setReplicationStatus(resourceResolver, replicatedBy, replicatedAt, ReplicationStatusManager.Status.DEACTIVATED, REPLICATED_PATH); assertSameTime(replicatedAt, replicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED).getDate()); assertEquals(replicatedBy, replicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED_BY).getString()); assertEquals(replicationStatus, replicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATION_ACTION).getString()); }
@Test public void testSetReplicationStatus_NullReplicatedByAndReplicatedAt() throws Exception { final String replicatedBy = null; final Calendar replicatedAt = null; replicationStatusManager.setReplicationStatus(resourceResolver, replicatedBy, replicatedAt, ReplicationStatusManager.Status.ACTIVATED, REPLICATED_PATH); assertNotNull(replicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED).getDate()); assertEquals(ReplicationStatusManagerImpl.DEFAULT_REPLICATED_BY, replicatedNode.getProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED_BY).getString()); }
@Test public void testSetReplicationStatus2() throws Exception { replicationStatusManager.setReplicationStatus(resourceResolver, null, null, ReplicationStatusManager.Status.CLEAR, REPLICATED_PATH); assertFalse(replicatedNode.hasProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED)); assertFalse(replicatedNode.hasProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATED_BY)); assertFalse(replicatedNode.hasProperty(ReplicationStatus.NODE_PROPERTY_LAST_REPLICATION_ACTION)); }