@Test
  public void replicationTypeFromConfigTest() {

    ReplicationConfig initialReplicationConfig = replicationConfig;
    properties.remove("replication.model.across.datacenters");
    replicationConfig = new ReplicationConfig(new VerifiableProperties(properties));

    //When replication config is missing, replicationModelType should be defaulted to ALL_TO_ALL
    assertEquals("Replication model mismatch from the value present in config",
        replicationConfig.replicationModelAcrossDatacenters, ReplicationModelType.ALL_TO_ALL);

    //When the config set is "LEADER_BASED", replicationModelType should be LEADER_BASED
    properties.setProperty("replication.model.across.datacenters", "LEADER_BASED");
    replicationConfig = new ReplicationConfig(new VerifiableProperties(properties));
    assertEquals("Replication model mismatch from the value present in config",
        replicationConfig.replicationModelAcrossDatacenters, ReplicationModelType.LEADER_BASED);

    //When the config set is "ALL_TO_ALL", replicationModelType should be ALL_TO_ALL
    properties.setProperty("replication.model.across.datacenters", "ALL_TO_ALL");
    replicationConfig = new ReplicationConfig(new VerifiableProperties(properties));
    assertEquals("Replication model mismatch from the value present in config",
        replicationConfig.replicationModelAcrossDatacenters, ReplicationModelType.ALL_TO_ALL);

    replicationConfig = initialReplicationConfig;
  }
Tests to verify replication model is correctly reflected in code based on config properties
ambry-replication/src/test/java/com/github/ambry/replication/LeaderBasedReplicationTest.java