DatastoreV1 { public Write write() { return new Write(null, null); } DatastoreV1(); DatastoreV1.Read read(); Write write(); DeleteEntity deleteEntity(); DeleteKey deleteKey();  }
@Test public void testWriteDisplayData() { Write write = DatastoreIO.v1().write().withProjectId(PROJECT_ID); DisplayData displayData = DisplayData.from(write); assertThat(displayData, hasDisplayItem("projectId", PROJECT_ID)); }
@Test public void testWritePrimitiveDisplayData() { DisplayDataEvaluator evaluator = DisplayDataEvaluator.create(); PTransform<PCollection<Entity>, ?> write = DatastoreIO.v1().write().withProjectId("myProject"); Set<DisplayData> displayData = evaluator.displayDataForPrimitiveTransforms(write); assertThat( "DatastoreIO write should include the project in its primitive display data", displayData, hasItem(hasDisplayItem("projectId"))); assertThat( "DatastoreIO write should include the upsertFn in its primitive display data", displayData, hasItem(hasDisplayItem("upsertFn"))); }
@Test public void testBuildWrite() throws Exception { DatastoreV1.Write write = DatastoreIO.v1().write().withProjectId(PROJECT_ID); assertEquals(PROJECT_ID, write.getProjectId()); }