use of org.apache.beam.sdk.transforms.display.DisplayDataEvaluator in project beam by apache.
the class PubsubIOTest method testPrimitiveReadDisplayData.
@Test
public void testPrimitiveReadDisplayData() {
DisplayDataEvaluator evaluator = DisplayDataEvaluator.create();
Set<DisplayData> displayData;
PubsubIO.Read<String> baseRead = PubsubIO.readStrings();
// Reading from a subscription.
PubsubIO.Read<String> read = baseRead.fromSubscription("projects/project/subscriptions/subscription");
displayData = evaluator.displayDataForPrimitiveSourceTransforms(read);
assertThat("PubsubIO.Read should include the subscription in its primitive display data", displayData, hasItem(hasDisplayItem("subscription")));
// Reading from a topic.
read = baseRead.fromTopic("projects/project/topics/topic");
displayData = evaluator.displayDataForPrimitiveSourceTransforms(read);
assertThat("PubsubIO.Read should include the topic in its primitive display data", displayData, hasItem(hasDisplayItem("topic")));
}
Aggregations