use of com.google.cloud.pubsub.spi.v1.TopicAdminSettings in project flink by apache.
the class PubsubHelper method getTopicAdminClient.
public TopicAdminClient getTopicAdminClient() throws IOException {
if (topicClient == null) {
TopicAdminSettings topicAdminSettings = TopicAdminSettings.newBuilder().setTransportChannelProvider(channelProvider).setCredentialsProvider(EmulatorCredentialsProvider.create()).build();
topicClient = TopicAdminClient.create(topicAdminSettings);
}
return topicClient;
}
use of com.google.cloud.pubsub.spi.v1.TopicAdminSettings 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);
});
}
Aggregations