Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add Kinesis ingestion samples #1947

Merged
merged 10 commits into from
Mar 21, 2024
Prev Previous commit
Next Next commit
style: fix formatting in tests
  • Loading branch information
michaelpri10 committed Mar 13, 2024
commit adc9a3dba08967cd8cf3204d3f2954b6c13de379
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public static void updateTopicTypeExample(

Topic response = topicAdminClient.updateTopic(request);

System.out.println("Updated topic with Kinesis ingestion settings: " + response.getAllFields());
System.out.println(
"Updated topic with Kinesis ingestion settings: " + response.getAllFields());
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions samples/snippets/src/test/java/pubsub/AdminIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ public void testAdmin() throws Exception {
// Update topic type to Kinesis ingestion.
UpdateTopicTypeExample.updateTopicTypeExample(
projectId, topicId, streamArn, consumerArn, awsRoleArn, gcpServiceAccount);
assertThat(bout.toString()).contains("google.pubsub.v1.Topic.name=" + ingestionTopicName.toString());
assertThat(bout.toString())
.contains("google.pubsub.v1.Topic.name=" + ingestionTopicName.toString());
assertThat(bout.toString()).contains(streamArn);
assertThat(bout.toString()).contains(consumerArn);
assertThat(bout.toString()).contains(awsRoleArn);
Expand All @@ -305,7 +306,8 @@ public void testAdmin() throws Exception {
// Test create topic with Kinesis ingestion settings.
CreateTopicWithKinesisIngestionExample.createTopicWithKinesisIngestionExample(
projectId, ingestionTopicId, streamArn, consumerArn, awsRoleArn, gcpServiceAccount);
assertThat(bout.toString()).contains("google.pubsub.v1.Topic.name=" + ingestionTopicName.toString());
assertThat(bout.toString())
.contains("google.pubsub.v1.Topic.name=" + ingestionTopicName.toString());
assertThat(bout.toString()).contains(streamArn);
assertThat(bout.toString()).contains(consumerArn);
assertThat(bout.toString()).contains(awsRoleArn);
Expand All @@ -315,7 +317,8 @@ public void testAdmin() throws Exception {
// Test update existing Kinesis ingestion settings.
UpdateTopicTypeExample.updateTopicTypeExample(
projectId, ingestionTopicId, streamArn, consumerArn2, awsRoleArn, gcpServiceAccount);
assertThat(bout.toString()).contains("google.pubsub.v1.Topic.name=" + ingestionTopicName.toString());
assertThat(bout.toString())
.contains("google.pubsub.v1.Topic.name=" + ingestionTopicName.toString());
assertThat(bout.toString()).contains(streamArn);
assertThat(bout.toString()).contains(consumerArn2);
assertThat(bout.toString()).contains(awsRoleArn);
Expand Down