Skip to content

Commit

Permalink
test: Adding unique identifier to Notification Samples Topics (#1364)
Browse files Browse the repository at this point in the history
* test: Adding unique identifier to Notification Samples Topics

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
sydney-munro and gcf-owl-bot[bot] committed Apr 22, 2022
1 parent 6c3dcf4 commit 1619825
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.iam.v1.SetIamPolicyRequest;
import java.io.IOException;
import java.util.Map;
import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Expand All @@ -39,7 +40,9 @@ public class CreateBucketPubSubNotificationTest extends TestBase {
Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String TOPIC = String.format("projects/%s/topics/new-topic-create", PROJECT);
private static final String ID = UUID.randomUUID().toString().substring(0, 8);
private static final String TOPIC =
String.format("projects/%s/topics/new-topic-create-%s", PROJECT, ID);
private static final String OBJECT_NAME_PREFIX = "index.html";
private static final EventType[] EVENT_TYPES = {
EventType.OBJECT_FINALIZE, EventType.OBJECT_METADATA_UPDATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.iam.v1.SetIamPolicyRequest;
import java.io.IOException;
import java.util.Map;
import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Expand All @@ -39,7 +40,9 @@ public class DeleteBucketPubSubNotificationTest extends TestBase {
Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String TOPIC = String.format("projects/%s/topics/new-topic-delete", PROJECT);
private static final String ID = UUID.randomUUID().toString().substring(0, 8);
private static final String TOPIC =
String.format("projects/%s/topics/new-topic-delete-%s", PROJECT, ID);
private static TopicAdminClient topicAdminClient;
private static final NotificationInfo notificationInfo =
NotificationInfo.newBuilder(TOPIC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.iam.v1.SetIamPolicyRequest;
import java.io.IOException;
import java.util.Map;
import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Expand All @@ -39,7 +40,9 @@ public class ListPubSubNotificationsTest extends TestBase {
Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String TOPIC = String.format("projects/%s/topics/new-topic-list", PROJECT);
private static final String ID = UUID.randomUUID().toString().substring(0, 8);
private static final String TOPIC =
String.format("projects/%s/topics/new-topic-list-%s", PROJECT, ID);
private static TopicAdminClient topicAdminClient;

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.iam.v1.SetIamPolicyRequest;
import java.io.IOException;
import java.util.Map;
import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Expand All @@ -39,7 +40,9 @@ public class PrintPubSubNotificationTest extends TestBase {
Notification.PayloadFormat.JSON_API_V1.JSON_API_V1;
private static final Map<String, String> CUSTOM_ATTRIBUTES = ImmutableMap.of("label1", "value1");
private static final String PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String TOPIC = String.format("projects/%s/topics/new-topic-print", PROJECT);
private static final String ID = UUID.randomUUID().toString().substring(0, 8);
private static final String TOPIC =
String.format("projects/%s/topics/new-topic-print-%s", PROJECT, ID);
private static TopicAdminClient topicAdminClient;

@BeforeClass
Expand Down

0 comments on commit 1619825

Please sign in to comment.