You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/11/06 00:31:01 UTC
[GitHub] [beam] TheNeuralBit commented on a change in pull request #13273: [BEAM-11159] Use GCP pubsub client for TestPubsub
TheNeuralBit commented on a change in pull request #13273:
URL: https://github.com/apache/beam/pull/13273#discussion_r518452956
##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/TestPubsub.java
##########
@@ -195,43 +227,46 @@ public SubscriptionPath subscriptionPath() {
return subscriptionPath;
}
- private List<SubscriptionPath> listSubscriptions(ProjectPath projectPath, TopicPath topicPath)
- throws IOException {
- return pubsub.listSubscriptions(projectPath, topicPath).stream()
- .filter((path) -> !path.equals(subscriptionPath))
- .collect(ImmutableList.toImmutableList());
+ private Iterable<String> listSubscriptions(TopicPath topicPath) {
+ assert topicAdmin != null;
+ return topicAdmin.listTopicSubscriptions(topicPath.getPath()).iterateAll();
}
/** Publish messages to {@link #topicPath()}. */
- public void publish(List<PubsubMessage> messages) throws IOException {
- List<PubsubClient.OutgoingMessage> outgoingMessages =
- messages.stream().map(this::toOutgoingMessage).collect(toList());
- pubsub.publish(eventsTopicPath, outgoingMessages);
- }
+ public void publish(List<PubsubMessage> messages) {
+ assert eventsTopicPath != null;
Review comment:
Good point, done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org