use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.Write in project beam by apache.
the class DatastoreV1Test method testWriteValidationSucceedsWithProject.
@Test
public void testWriteValidationSucceedsWithProject() throws Exception {
Write write = DatastoreIO.v1().write().withProjectId(PROJECT_ID);
write.validate(null);
}
use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.Write in project beam by apache.
the class DatastoreV1Test method testWriteValidationFailsWithNoProjectInStaticValueProvider.
@Test
public void testWriteValidationFailsWithNoProjectInStaticValueProvider() throws Exception {
Write write = DatastoreIO.v1().write().withProjectId(StaticValueProvider.<String>of(null));
thrown.expect(NullPointerException.class);
thrown.expectMessage("projectId");
write.validate(null);
}
use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.Write in project beam by apache.
the class DatastoreV1Test method testWriteValidationFailsWithNoProject.
@Test
public void testWriteValidationFailsWithNoProject() throws Exception {
Write write = DatastoreIO.v1().write();
thrown.expect(NullPointerException.class);
thrown.expectMessage("projectId ValueProvider");
write.validate(null);
}
use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.Write in project beam by apache.
the class DatastoreV1Test method testWriteDisplayData.
@Test
public void testWriteDisplayData() {
Write write = DatastoreIO.v1().write().withProjectId(PROJECT_ID);
DisplayData displayData = DisplayData.from(write);
assertThat(displayData, hasDisplayItem("projectId", PROJECT_ID));
}
use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.Write in project beam by apache.
the class DatastoreV1Test method testBuildWrite.
/**
* Test building a Write using builder methods.
*/
@Test
public void testBuildWrite() throws Exception {
DatastoreV1.Write write = DatastoreIO.v1().write().withProjectId(PROJECT_ID);
assertEquals(PROJECT_ID, write.getProjectId());
}
Aggregations