From 85d3119d476b47f3ec28396d0107f15092c9b4f9 Mon Sep 17 00:00:00 2001 From: dpcollins-google <40498610+dpcollins-google@users.noreply.github.com> Date: Tue, 26 Jan 2021 12:15:37 -0500 Subject: [PATCH] fix: update exception handling exposed by underlying API translating changes (#53) * fix: Incorrect exception handling exposed by underlying API translating ExecutionException differently. * fix: reformat --- pom.xml | 4 ++-- .../com/google/cloud/pubsublite/kafka/SharedBehaviorTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 2f25549b..614736d8 100644 --- a/pom.xml +++ b/pom.xml @@ -17,12 +17,12 @@ com.google.api.grpc proto-google-cloud-pubsublite-v1 - 0.7.0 + 0.8.0 com.google.cloud google-cloud-pubsublite - 0.7.0 + 0.8.0 org.apache.kafka diff --git a/src/test/java/com/google/cloud/pubsublite/kafka/SharedBehaviorTest.java b/src/test/java/com/google/cloud/pubsublite/kafka/SharedBehaviorTest.java index 9ef468a0..9a116b99 100644 --- a/src/test/java/com/google/cloud/pubsublite/kafka/SharedBehaviorTest.java +++ b/src/test/java/com/google/cloud/pubsublite/kafka/SharedBehaviorTest.java @@ -31,7 +31,7 @@ import java.time.Duration; import java.util.List; import org.apache.kafka.common.PartitionInfo; -import org.apache.kafka.common.errors.BrokerNotAvailableException; +import org.apache.kafka.common.errors.InvalidRequestException; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -71,7 +71,7 @@ public void partitionsForFailure() { ApiFutures.immediateFailedFuture( new CheckedApiException(StatusCode.Code.FAILED_PRECONDITION).underlying)); assertThrows( - BrokerNotAvailableException.class, + InvalidRequestException.class, () -> shared.partitionsFor(example(TopicPath.class), Duration.ofMillis(10))); }