Search in sources :

Example 1 with DeleteKey

use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey in project beam by apache.

the class DatastoreV1Test method testDeleteKeyValidationSucceedsWithProject.

@Test
public void testDeleteKeyValidationSucceedsWithProject() throws Exception {
    DeleteKey deleteKey = DatastoreIO.v1().deleteKey().withProjectId(PROJECT_ID);
    deleteKey.validate(null);
}
Also used : DeleteKey(org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey) Test(org.junit.Test)

Example 2 with DeleteKey

use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey in project beam by apache.

the class DatastoreV1Test method testDeleteKeyDisplayData.

@Test
public void testDeleteKeyDisplayData() {
    DeleteKey deleteKey = DatastoreIO.v1().deleteKey().withProjectId(PROJECT_ID);
    DisplayData displayData = DisplayData.from(deleteKey);
    assertThat(displayData, hasDisplayItem("projectId", PROJECT_ID));
}
Also used : DeleteKey(org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey) DisplayData(org.apache.beam.sdk.transforms.display.DisplayData) Test(org.junit.Test)

Example 3 with DeleteKey

use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey in project beam by apache.

the class DatastoreV1Test method testDeleteKeyValidationFailsWithNoProjectInStaticValueProvider.

@Test
public void testDeleteKeyValidationFailsWithNoProjectInStaticValueProvider() throws Exception {
    DeleteKey deleteKey = DatastoreIO.v1().deleteKey().withProjectId(StaticValueProvider.<String>of(null));
    thrown.expect(NullPointerException.class);
    thrown.expectMessage("projectId");
    deleteKey.validate(null);
}
Also used : DeleteKey(org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey) Test(org.junit.Test)

Example 4 with DeleteKey

use of org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey in project beam by apache.

the class DatastoreV1Test method testDeleteKeyValidationFailsWithNoProject.

@Test
public void testDeleteKeyValidationFailsWithNoProject() throws Exception {
    DeleteKey deleteKey = DatastoreIO.v1().deleteKey();
    thrown.expect(NullPointerException.class);
    thrown.expectMessage("projectId ValueProvider");
    deleteKey.validate(null);
}
Also used : DeleteKey(org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey) Test(org.junit.Test)

Aggregations

DeleteKey (org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteKey)4 Test (org.junit.Test)4 DisplayData (org.apache.beam.sdk.transforms.display.DisplayData)1