### Question:
CircusTrainConfig { public static Builder builder() { return new Builder(); } private  CircusTrainConfig(Builder builder); static Builder builder(); SourceCatalog getSourceCatalog(); ReplicaCatalog getReplicaCatalog(); Map<String, String> getCopierOptions(); List<TableReplication> getTableReplications();  }### Answer:
@Test public void missingSourceMetasStoreUri() { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("sourceMetaStoreUri is not set"); CircusTrainConfig .builder() .sourceName("sourceName") .replicaName("replicaName") .replicaMetaStoreUri("replicaMetaStoreUri") .replication(ReplicationMode.METADATA_UPDATE, "databaseName", "tableName", "replicaDatabaseName", "replicaTableName", "replicaTableLocation", OrphanedDataStrategy.HOUSEKEEPING) .build(); }
@Test public void missingReplicaMetasStoreUri() { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("replicaMetaStoreUri is not set"); CircusTrainConfig .builder() .sourceName("sourceName") .sourceMetaStoreUri("sourceMetaStoreUri") .replicaName("replicaName") .replication(ReplicationMode.METADATA_UPDATE, "databaseName", "tableName", "replicaDatabaseName", "replicaTableName", "replicaTableLocation", OrphanedDataStrategy.HOUSEKEEPING) .build(); }
@Test public void missingReplications() { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("tableReplications is not set"); CircusTrainConfig .builder() .sourceName("sourceName") .sourceMetaStoreUri("sourceMetaStoreUri") .replicaName("replicaName") .replicaMetaStoreUri("replicaMetaStoreUri") .build(); }
@Test(expected = NullPointerException.class) public void nullSourceCatalogName() { CircusTrainConfig.builder().sourceName(null); }
@Test(expected = NullPointerException.class) public void nullSourceMetaStoreUri() { CircusTrainConfig.builder().sourceMetaStoreUri(null); }
@Test(expected = NullPointerException.class) public void nullReplicaCatalogName() { CircusTrainConfig.builder().replicaName(null); }
@Test(expected = NullPointerException.class) public void nullReplicaMetaStoreUri() { CircusTrainConfig.builder().replicaMetaStoreUri(null); }
@Test(expected = NullPointerException.class) public void nullReplicationMode() { CircusTrainConfig .builder() .replication(null, "databaseName", "tableName", "replicaDatabaseName", "replicaTableName", "replicaTableLocation", OrphanedDataStrategy.HOUSEKEEPING); }
@Test(expected = NullPointerException.class) public void nullDatabaseName() { CircusTrainConfig .builder() .replication(ReplicationMode.METADATA_MIRROR, null, "tableName", "replicaDatabaseName", "replicaTableName", "replicaTableLocation", OrphanedDataStrategy.HOUSEKEEPING); }
@Test(expected = NullPointerException.class) public void nullTableName() { CircusTrainConfig .builder() .replication(ReplicationMode.METADATA_MIRROR, "databaseName", null, "replicaDatabaseName", "replicaTableName", "replicaTableLocation", OrphanedDataStrategy.HOUSEKEEPING); }
@Test(expected = NullPointerException.class) public void nullReplicaTableLocation() { CircusTrainConfig .builder() .replication(ReplicationMode.METADATA_MIRROR, "databaseName", "tableName", "replicaDatabaseName", "replicaTableName", null, OrphanedDataStrategy.HOUSEKEEPING); }
@Test(expected = NullPointerException.class) public void nullOrphanedDataStrategy() { CircusTrainConfig .builder() .replication(ReplicationMode.METADATA_MIRROR, "databaseName", "tableName", "replicaDatabaseName", "replicaTableName", "replicaTableLocation", null); }