From 6c030d672ef6fd7b674f607d9f3547537ffffb92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 04:43:16 +0000 Subject: [PATCH 1/5] deps: bump com.google.cloud:libraries-bom from 26.49.0 to 26.51.0 Bumps [com.google.cloud:libraries-bom](https://github.com/googleapis/java-cloud-bom) from 26.49.0 to 26.51.0. - [Release notes](https://github.com/googleapis/java-cloud-bom/releases) - [Changelog](https://github.com/googleapis/java-cloud-bom/blob/main/release-please-config.json) - [Commits](https://github.com/googleapis/java-cloud-bom/compare/v26.49.0...v26.51.0) --- updated-dependencies: - dependency-name: com.google.cloud:libraries-bom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- spring-cloud-gcp-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index 6aa7ac6cbe..f75e40e79b 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -34,7 +34,7 @@ - 26.49.0 + 26.51.0 1.21.0 1.0.7.RELEASE 1.3.0 From 889ac6e811e53b483c3a816ed02d036c8fa50b3e Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Thu, 5 Dec 2024 13:52:43 -0500 Subject: [PATCH 2/5] add additional mock --- .../spring/pubsub/support/DefaultPublisherFactoryTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultPublisherFactoryTests.java b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultPublisherFactoryTests.java index 1fc4e7df42..71b94953a1 100644 --- a/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultPublisherFactoryTests.java +++ b/spring-cloud-gcp-pubsub/src/test/java/com/google/cloud/spring/pubsub/support/DefaultPublisherFactoryTests.java @@ -19,6 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -46,6 +47,7 @@ public void setUp() throws IOException { factory.setCredentialsProvider(NoCredentialsProvider.create()); TransportChannelProvider mockChannelProvider = mock(TransportChannelProvider.class); TransportChannel mockTransportChannel = mock(TransportChannel.class); + when(mockChannelProvider.withUseS2A(anyBoolean())).thenReturn(mockChannelProvider); when(mockChannelProvider.getTransportChannel()).thenReturn(mockTransportChannel); ApiCallContext mockContext = mock(ApiCallContext.class); when(mockTransportChannel.getEmptyCallContext()).thenReturn(mockContext); From 06a397a5151bbca0ca1bab5e6e45fcbdba870e4f Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Thu, 5 Dec 2024 14:58:53 -0500 Subject: [PATCH 3/5] remove redundant null-checker (and avoid ImpossibleNullComparison) --- .../spring/autoconfigure/trace/pubsub/TraceHelperTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TraceHelperTests.java b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TraceHelperTests.java index 648d449d49..44794b52b2 100644 --- a/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TraceHelperTests.java +++ b/spring-cloud-gcp-autoconfigure/src/test/java/com/google/cloud/spring/autoconfigure/trace/pubsub/TraceHelperTests.java @@ -66,7 +66,6 @@ void should_inject_child_context() { assertThat(producerSpan.kind()).isEqualTo(PRODUCER); assertChildOf(producerSpan, parent); assertThat(instrumentedMessage.getAttributesMap()) - .isNotNull() .containsEntry("b3", producerSpan.traceId() + "-" + producerSpan.id() + "-1"); } From 9306d617e9006093dd72348177a86d7f8ed23257 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 6 Dec 2024 09:59:53 -0500 Subject: [PATCH 4/5] add openteletry-bom --- spring-cloud-gcp-dependencies/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index f75e40e79b..7bdc2df6ab 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -38,6 +38,7 @@ 1.21.0 1.0.7.RELEASE 1.3.0 + 1.42.1 @@ -276,6 +277,14 @@ cloud-spanner-r2dbc ${cloud-spanner-r2dbc.version} + + + io.opentelemetry + opentelemetry-bom + ${opentelemetry.version} + pom + import + From e22b37401c6e48ad5218d3470f3bab7fc25e7f22 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Fri, 6 Dec 2024 10:09:24 -0500 Subject: [PATCH 5/5] add additional mock --- .../v2/spring/LanguageAutoConfigurationTests.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/spring-cloud-previews/google-cloud-language-spring-starter/src/test/java/com/google/cloud/language/v2/spring/LanguageAutoConfigurationTests.java b/spring-cloud-previews/google-cloud-language-spring-starter/src/test/java/com/google/cloud/language/v2/spring/LanguageAutoConfigurationTests.java index 2c6d3a6ab2..0f874a0330 100644 --- a/spring-cloud-previews/google-cloud-language-spring-starter/src/test/java/com/google/cloud/language/v2/spring/LanguageAutoConfigurationTests.java +++ b/spring-cloud-previews/google-cloud-language-spring-starter/src/test/java/com/google/cloud/language/v2/spring/LanguageAutoConfigurationTests.java @@ -18,6 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.when; import com.google.api.gax.core.CredentialsProvider; @@ -53,10 +54,14 @@ class LanguageAutoConfigurationTests { private static final String TRANSPORT_CHANNEL_PROVIDER_QUALIFIER_NAME = "defaultLanguageServiceTransportChannelProvider"; - @Mock private TransportChannel mockTransportChannel; - @Mock private ApiCallContext mockApiCallContext; - @Mock private TransportChannelProvider mockTransportChannelProvider; - @Mock private CredentialsProvider mockCredentialsProvider; + @Mock + private TransportChannel mockTransportChannel; + @Mock + private ApiCallContext mockApiCallContext; + @Mock + private TransportChannelProvider mockTransportChannelProvider; + @Mock + private CredentialsProvider mockCredentialsProvider; private ApplicationContextRunner contextRunner = new ApplicationContextRunner() @@ -192,6 +197,8 @@ void testExecutorThreadCountFromProperties() { void testCustomTransportChannelProviderUsedWhenProvided() throws IOException { when(mockTransportChannelProvider.getTransportName()).thenReturn("grpc"); when(mockTransportChannelProvider.getTransportChannel()).thenReturn(mockTransportChannel); + when(mockTransportChannelProvider.withUseS2A(anyBoolean())) + .thenReturn(mockTransportChannelProvider); when(mockTransportChannel.getEmptyCallContext()).thenReturn(mockApiCallContext); when(mockApiCallContext.withCredentials(any())).thenReturn(mockApiCallContext); when(mockApiCallContext.withTransportChannel(any())).thenReturn(mockApiCallContext);