Search in sources :

Example 1 with PubSubMessageChannelBinder

use of org.springframework.cloud.gcp.stream.binder.pubsub.PubSubMessageChannelBinder in project spring-cloud-gcp by spring-cloud.

the class PubSubExtendedBindingsPropertiesTests method testExtendedPropertiesOverrideDefaults.

@Test
public void testExtendedPropertiesOverrideDefaults() {
    BinderFactory binderFactory = this.context.getBeanFactory().getBean(BinderFactory.class);
    PubSubMessageChannelBinder binder = (PubSubMessageChannelBinder) binderFactory.getBinder("pubsub", MessageChannel.class);
    assertThat(binder.getExtendedConsumerProperties("custom-in").isAutoCreateResources()).isFalse();
    assertThat(binder.getExtendedConsumerProperties("input").isAutoCreateResources()).isTrue();
    assertThat(binder.getExtendedConsumerProperties("custom-in").getAckMode()).isEqualTo(AckMode.AUTO);
    assertThat(binder.getExtendedConsumerProperties("input").getAckMode()).isEqualTo(AckMode.AUTO_ACK);
}
Also used : PubSubMessageChannelBinder(org.springframework.cloud.gcp.stream.binder.pubsub.PubSubMessageChannelBinder) BinderFactory(org.springframework.cloud.stream.binder.BinderFactory) MessageChannel(org.springframework.messaging.MessageChannel) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Test (org.junit.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1 PubSubMessageChannelBinder (org.springframework.cloud.gcp.stream.binder.pubsub.PubSubMessageChannelBinder)1 BinderFactory (org.springframework.cloud.stream.binder.BinderFactory)1 MessageChannel (org.springframework.messaging.MessageChannel)1