From 300c60459ee91669c20283bcc986737002a9ffb6 Mon Sep 17 00:00:00 2001 From: athakor Date: Thu, 18 Jun 2020 17:54:44 +0530 Subject: [PATCH] feat: implement getNotification inside StorageRpcTestBase class and fix the builds checks --- .../cloud/storage/testing/StorageRpcTestBase.java | 5 +++++ .../com/google/cloud/storage/StorageImplTest.java | 3 +-- .../cloud/storage/testing/StorageRpcTestBaseTest.java | 11 +++++++++++ pom.xml | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java index 6bd2d487e..0f8e651a6 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/testing/StorageRpcTestBase.java @@ -280,6 +280,11 @@ public Notification createNotification(String bucket, Notification notification) throw new UnsupportedOperationException("Not implemented yet"); } + @Override + public Notification getNotification(String bucket, String notification) { + throw new UnsupportedOperationException("Not implemented yet"); + } + @Override public Bucket lockRetentionPolicy(Bucket bucket, Map options) { throw new UnsupportedOperationException("Not implemented yet"); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java index ce57c6068..ec06f2648 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/StorageImplTest.java @@ -57,7 +57,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.io.BaseEncoding; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; @@ -2558,6 +2557,6 @@ private void compareBucketsNotification(Notification value) { assertEquals(EVENT_TYPES, value.getEventTypes()); assertEquals(OBJECT_NAME_PREFIX, value.getObjectNamePrefix()); assertEquals(PAYLOAD_FORMAT.name(), value.getPayloadFormat()); - assertEquals(TOPIC.toString(), value.getTopic()); + assertEquals(TOPIC, value.getTopic()); } } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/StorageRpcTestBaseTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/StorageRpcTestBaseTest.java index b798ad572..7feef9f18 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/StorageRpcTestBaseTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/testing/StorageRpcTestBaseTest.java @@ -577,6 +577,17 @@ public Notification call() { }; } + @Test + public void testGetNotification() { + rpc = + new Callable() { + @Override + public Notification call() { + return STORAGE_RPC.getNotification("bucket", "notification"); + } + }; + } + @Test public void testLockRetentionPolicy() { rpc = diff --git a/pom.xml b/pom.xml index 98e348d93..0916ace63 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ com.google.cloud google-cloud-pubsub - 1.105.0 + 1.106.0 test