From a191456ee6e51196fc990ba8767000bcc3ddd8a7 Mon Sep 17 00:00:00 2001 From: Brian Collins Date: Tue, 5 Nov 2024 16:53:11 -0800 Subject: [PATCH] deps: update google-cloud-shared-config to 1.11.3 deps: update google-cloud-shared-dependencies to 3.39.0 deps: use google-cloud-bom 0.231.0 instead of libraries-bom deps: depend on pubsublite libraries from google-cloud-bom deps: update pubsublite-kafka to 1.2.2 deps: update flogger to 0.8 fix: An optimization in guava 33.3.0 broke our tests by not calling `addListener()` on futures which are already `isDone()`. Add mock call to make our futures not `isDone()` in some tests. --- pom.xml | 23 +++++-------------- .../kafka/sink/CloudPubSubSinkTaskTest.java | 3 +++ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index e1dff029..1f3646a9 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.8.0 + 1.11.3 @@ -30,23 +30,17 @@ com.google.cloud google-cloud-shared-dependencies - 3.20.0 + 3.39.0 pom import com.google.cloud - libraries-bom - 26.11.0 + google-cloud-bom + 0.231.0 pom import - - - com.google.api.grpc - grpc-google-cloud-pubsublite-v1 - 1.12.1 - @@ -54,25 +48,20 @@ com.google.api.grpc proto-google-cloud-pubsublite-v1 - - 1.12.1 com.google.cloud google-cloud-pubsublite - - 1.12.1 com.google.cloud pubsublite-kafka - 1.2.1 + 1.2.2 com.google.cloud google-cloud-pubsub - com.google.protobuf protobuf-java @@ -85,7 +74,7 @@ com.google.flogger google-extensions - 0.7.4 + 0.8 com.google.code.findbugs diff --git a/src/test/java/com/google/pubsub/kafka/sink/CloudPubSubSinkTaskTest.java b/src/test/java/com/google/pubsub/kafka/sink/CloudPubSubSinkTaskTest.java index e1d4cb6d..d25918f3 100644 --- a/src/test/java/com/google/pubsub/kafka/sink/CloudPubSubSinkTaskTest.java +++ b/src/test/java/com/google/pubsub/kafka/sink/CloudPubSubSinkTaskTest.java @@ -336,6 +336,7 @@ public void testFlushWithNoPublishInPut() throws Exception { partitionOffsets.put(new TopicPartition(KAFKA_TOPIC, 0), null); List records = getSampleRecords(); ApiFuture goodFuture = getSuccessfulPublishFuture(); + when(goodFuture.isDone()).thenReturn(false); when(publisher.publish(any(PubsubMessage.class))).thenReturn(goodFuture); task.put(records); task.flush(partitionOffsets); @@ -578,7 +579,9 @@ public void testFlushExceptionThenNoExceptionCase() throws Exception { partitionOffsets.put(new TopicPartition(KAFKA_TOPIC, 0), null); List records = getSampleRecords(); ApiFuture badFuture = getFailedPublishFuture(); + when(badFuture.isDone()).thenReturn(false); ApiFuture goodFuture = getSuccessfulPublishFuture(); + when(goodFuture.isDone()).thenReturn(false); when(publisher.publish(any(PubsubMessage.class))) .thenReturn(badFuture) .thenReturn(badFuture)