CloudBigtableIO { public static PTransform<PCollection<KV<String, Iterable<Mutation>>>, PDone> writeToMultipleTables(CloudBigtableConfiguration config) { return new CloudBigtableWriteTransform<>(new CloudBigtableMultiTableWriteFn(config), config); }  static PTransform<PCollection<Mutation>, PDone> writeToTable(
      CloudBigtableTableConfiguration config); static PTransform<PCollection<KV<String, Iterable<Mutation>>>, PDone> writeToMultipleTables(CloudBigtableConfiguration config); static BoundedSource<Result> read(CloudBigtableScanConfiguration config);  }
@Test public void testWriteToMultipleTablesValidateConfig() throws Exception { CloudBigtableConfiguration config = new CloudBigtableConfiguration.Builder() .withProjectId("project") .withInstanceId("instanceId") .build(); CloudBigtableIO.writeToMultipleTables(config).validate(null); try { CloudBigtableIO.writeToMultipleTables(config.toBuilder().withProjectId("").build()) .validate(null); Assert.fail("Expect IllegalArgumentException"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().contains("A projectId must be set")); } try { CloudBigtableIO.writeToMultipleTables(config.toBuilder().withInstanceId("").build()) .validate(null); Assert.fail("Expect IllegalArgumentException"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().contains("A instanceId must be set")); } }