Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
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: Format AdmitIT
  • Loading branch information
michaelpri10 committed Mar 7, 2024
commit f19831747e05d94150cb2d505723ef5eb0e85f44
16 changes: 10 additions & 6 deletions samples/snippets/src/test/java/pubsub/AdminIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ public class AdminIT {
"java_samples_data_set" + _suffix.replace("-", "_");
private static final String bigquerySubscriptionId = "iam-bigquery-subscription-" + _suffix;
private static final String bigqueryTableId = "java_samples_table_" + _suffix;
private static final String streamArn = "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name";
private static final String consumerArn = "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111";
private static final String streamArn =
"arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name";
private static final String consumerArn =
"arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111";
private static final String awsRoleArn = "arn:aws:iam::111111111111:role/fake-role-name";
private static final String gcpServiceAccount = "[email protected]";
private static final String gcpServiceAccount =
"[email protected]";

private static final TopicName topicName = TopicName.of(projectId, topicId);
private static final TopicName ingestionTopicName = TopicName.of(projectId, ingestionTopicId);
Expand All @@ -82,7 +85,6 @@ public class AdminIT {
private static final SubscriptionName exactlyOnceSubscriptionName =
SubscriptionName.of(projectId, exactlyOnceSubscriptionId);


private static void requireEnvVar(String varName) {
assertNotNull(
"Environment variable " + varName + " is required to perform these tests.",
Expand Down Expand Up @@ -282,8 +284,10 @@ public void testAdmin() throws Exception {

bout.reset();
// Update topic type to Kinesis ingestion.
UpdateTopicTypeExample.updateTopicTypeExample(projectId, topicId, streamArn, consumerArn, awsRoleArn, gcpServiceAccount);
assertThat(bout.toString()).contains("Updated topic with Kinesis ingestion settings: " + topicName.toString());
UpdateTopicTypeExample.updateTopicTypeExample(
projectId, topicId, streamArn, consumerArn, awsRoleArn, gcpServiceAccount);
assertThat(bout.toString())
.contains("Updated topic with Kinesis ingestion settings: " + topicName.toString());

bout.reset();
// Test delete topic.
Expand Down