Search in sources :

Example 6 with TransportChannelProvider

use of com.google.api.gax.rpc.TransportChannelProvider in project spring-cloud-gcp by spring-cloud.

the class GcpPubSubEmulatorAutoConfigurationTests method testEmulatorConfig.

@Test
public void testEmulatorConfig() {
    this.contextRunner.run((context) -> {
        CredentialsProvider defaultCredentialsProvider = context.getBean(CredentialsProvider.class);
        assertThat(defaultCredentialsProvider).isNotInstanceOf(NoCredentialsProvider.class);
        TopicAdminSettings topicAdminSettings = context.getBean(TopicAdminSettings.class);
        CredentialsProvider credentialsProvider = topicAdminSettings.getCredentialsProvider();
        assertThat(credentialsProvider).isInstanceOf(NoCredentialsProvider.class);
        TransportChannelProvider transportChannelProvider = context.getBean(TransportChannelProvider.class);
        assertThat(transportChannelProvider).isInstanceOf(FixedTransportChannelProvider.class);
    });
}
Also used : TopicAdminSettings(com.google.cloud.pubsub.v1.TopicAdminSettings) NoCredentialsProvider(com.google.api.gax.core.NoCredentialsProvider) CredentialsProvider(com.google.api.gax.core.CredentialsProvider) FixedTransportChannelProvider(com.google.api.gax.rpc.FixedTransportChannelProvider) TransportChannelProvider(com.google.api.gax.rpc.TransportChannelProvider) Test(org.junit.Test)

Aggregations

TransportChannelProvider (com.google.api.gax.rpc.TransportChannelProvider)6 Test (org.junit.Test)5 CredentialsProvider (com.google.api.gax.core.CredentialsProvider)3 NoCredentialsProvider (com.google.api.gax.core.NoCredentialsProvider)3 FixedTransportChannelProvider (com.google.api.gax.rpc.FixedTransportChannelProvider)3 ApplicationContextRunner (org.springframework.boot.test.context.runner.ApplicationContextRunner)3 Publisher (com.google.cloud.pubsub.v1.Publisher)1 TopicAdminClient (com.google.cloud.pubsub.v1.TopicAdminClient)1 TopicAdminSettings (com.google.cloud.pubsub.v1.TopicAdminSettings)1 TopicName (com.google.pubsub.v1.TopicName)1 ManagedChannel (io.grpc.ManagedChannel)1