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);