use of com.google.cloud.spring.pubsub.support.DefaultSubscriberFactory in project spring-cloud-gcp by GoogleCloudPlatform.
the class GcpPubSubAutoConfigurationTests method createSubscriberStub_flowControlSettings_noPropertiesSet.
@Test
void createSubscriberStub_flowControlSettings_noPropertiesSet() {
ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations.of(GcpPubSubAutoConfiguration.class)).withUserConfiguration(TestConfig.class);
contextRunner.run(ctx -> {
DefaultSubscriberFactory subscriberFactory = ctx.getBean("defaultSubscriberFactory", DefaultSubscriberFactory.class);
Subscriber subscriber = subscriberFactory.createSubscriber("subscription-name", (message, consumer) -> {
});
assertThat(subscriber.getFlowControlSettings()).isEqualTo(Subscriber.Builder.getDefaultFlowControlSettings());
});
}
Aggregations