Fix #2963 RocketMQ binder test NPE

pull/2965/head
ruansheng 2 years ago
parent be2d0f6c38
commit 2210917cd1

@ -16,12 +16,12 @@
package com.alibaba.cloud.stream.binder.rocketmq; package com.alibaba.cloud.stream.binder.rocketmq;
import javax.annotation.Resource;
import com.alibaba.cloud.stream.binder.rocketmq.autoconfigurate.ExtendedBindingHandlerMappingsProviderConfiguration; import com.alibaba.cloud.stream.binder.rocketmq.autoconfigurate.ExtendedBindingHandlerMappingsProviderConfiguration;
import com.alibaba.cloud.stream.binder.rocketmq.autoconfigurate.RocketMQBinderAutoConfiguration; import com.alibaba.cloud.stream.binder.rocketmq.autoconfigurate.RocketMQBinderAutoConfiguration;
import com.alibaba.cloud.stream.binder.rocketmq.constant.RocketMQConst; import com.alibaba.cloud.stream.binder.rocketmq.constant.RocketMQConst;
import com.alibaba.cloud.stream.binder.rocketmq.properties.RocketMQConsumerProperties; import com.alibaba.cloud.stream.binder.rocketmq.properties.RocketMQConsumerProperties;
import jakarta.annotation.Resource;
import org.assertj.core.api.Assertions; import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -57,27 +57,26 @@ public class RocketMQMessageChannelBinderTest {
@Resource @Resource
RocketMQMessageChannelBinder binder; RocketMQMessageChannelBinder binder;
// todo spring boot 3.0 upgrade: fix spring cloud stream binder @Test
// @Test public void createConsumerEndpoint() throws Exception {
// public void createConsumerEndpoint() throws Exception { TestConsumerDestination destination = new TestConsumerDestination("test");
// TestConsumerDestination destination = new TestConsumerDestination("test"); MessageProducer consumerEndpoint = binder.createConsumerEndpoint(destination, "test",
// MessageProducer consumerEndpoint = binder.createConsumerEndpoint(destination, "test", new ExtendedConsumerProperties<>(new RocketMQConsumerProperties()));
// new ExtendedConsumerProperties<>(new RocketMQConsumerProperties())); Assertions.assertThat(consumerEndpoint).isNotNull();
// Assertions.assertThat(consumerEndpoint).isNotNull(); }
// }
// @Test
// @Test public void createAnymousConsumerEndpoint() throws Exception {
// public void createAnymousConsumerEndpoint() throws Exception { ExtendedConsumerProperties<RocketMQConsumerProperties> extendedConsumerProperties
// ExtendedConsumerProperties<RocketMQConsumerProperties> extendedConsumerProperties = new ExtendedConsumerProperties<>(new RocketMQConsumerProperties());
// = new ExtendedConsumerProperties<>(new RocketMQConsumerProperties());
// TestConsumerDestination destination = new TestConsumerDestination("test");
// TestConsumerDestination destination = new TestConsumerDestination("test"); MessageProducer consumerEndpoint = binder.createConsumerEndpoint(destination, null,
// MessageProducer consumerEndpoint = binder.createConsumerEndpoint(destination, null, extendedConsumerProperties);
// extendedConsumerProperties); Assertions.assertThat(consumerEndpoint).isNotNull();
// Assertions.assertThat(consumerEndpoint).isNotNull(); Assertions.assertThat(extendedConsumerProperties.getExtension().getGroup())
// Assertions.assertThat(extendedConsumerProperties.getExtension().getGroup()) .isEqualTo(RocketMQConst.DEFAULT_GROUP + "_test");
// .isEqualTo(RocketMQConst.DEFAULT_GROUP + "_test"); }
// }
@Test @Test
public void createDLQAnymousConsumerEndpoint() throws Exception { public void createDLQAnymousConsumerEndpoint() throws Exception {

Loading…
Cancel
Save