CloudBigtableIO { public static PTransform<PCollection<Mutation>, PDone> writeToTable( CloudBigtableTableConfiguration config) { DoFn<Mutation, Void> writeFn = new CloudBigtableSingleTableBufferedWriteFn(config); return new CloudBigtableWriteTransform<>(writeFn, 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 testWriteToTableValidateConfig() throws Exception { CloudBigtableIO.writeToTable(scanConfig).validate(null); try { CloudBigtableIO.writeToTable(scanConfig.toBuilder().withProjectId("").build()).validate(null); Assert.fail("Expect IllegalArgumentException"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().contains("A projectId must be set")); } try { CloudBigtableIO.writeToTable(scanConfig.toBuilder().withInstanceId("").build()) .validate(null); Assert.fail("Expect IllegalArgumentException"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().contains("A instanceId must be set")); } try { CloudBigtableIO.writeToTable(scanConfig.toBuilder().withTableId("").build()).validate(null); Assert.fail("Expect IllegalArgumentException"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().contains("A tableid must be set")); } }