rocketmq anonymous group test: use AssertJ instead of Junit5
@@ -22,7 +22,7 @@ import com.alibaba.cloud.stream.binder.rocketmq.autoconfigurate.ExtendedBindingH
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.properties.RocketMQConsumerProperties;
-import org.junit.jupiter.api.Assertions;
+import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -61,7 +61,7 @@ public class RocketMQMessageChannelBinderTest {
TestConsumerDestination destination = new TestConsumerDestination("test");
MessageProducer consumerEndpoint = binder.createConsumerEndpoint(destination, "test",
new ExtendedConsumerProperties<>(new RocketMQConsumerProperties()));
- Assertions.assertNotNull(consumerEndpoint);
+ Assertions.assertThat(consumerEndpoint).isNotNull();
}
@Test
@@ -72,14 +72,15 @@ public class RocketMQMessageChannelBinderTest {
TestConsumerDestination destination = new TestConsumerDestination("test");
MessageProducer consumerEndpoint = binder.createConsumerEndpoint(destination, null,
extendedConsumerProperties);
- Assertions.assertNotNull(consumerEndpoint);
- Assertions.assertEquals(RocketMQConst.DEFAULT_GROUP + "_test", extendedConsumerProperties.getExtension().getGroup());
+ Assertions.assertThat(consumerEndpoint).isNotNull();
+ Assertions.assertThat( extendedConsumerProperties.getExtension().getGroup())
+ .isEqualTo(RocketMQConst.DEFAULT_GROUP + "_test");
}
@Test
public void createDLQAnymousConsumerEndpoint() throws Exception {
TestConsumerDestination destination = new TestConsumerDestination("%DLQ%test");
- Assertions.assertThrows(RuntimeException.class, () -> {
+ Assertions.assertThatThrownBy(() -> {
MessageProducer consumerEndpoint = binder.createConsumerEndpoint(destination, null,
new ExtendedConsumerProperties<>(new RocketMQConsumerProperties()));
});
