Main to 3.1; Upgrade Dependency Versions
Also compatibility changes for Mockito 5. * Upgrade Kotlin; fix test parameter names.
This commit is contained in:
34
build.gradle
34
build.gradle
@@ -1,5 +1,5 @@
|
||||
buildscript {
|
||||
ext.kotlinVersion = '1.7.0'
|
||||
ext.kotlinVersion = '1.9.10'
|
||||
ext.isCI = System.getenv('GITHUB_ACTION') || System.getenv('bamboo_buildKey')
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -42,7 +42,7 @@ ext {
|
||||
modifiedFiles =
|
||||
files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
|
||||
|
||||
assertjVersion = '3.23.1'
|
||||
assertjVersion = '3.24.2'
|
||||
assertkVersion = '0.24'
|
||||
awaitilityVersion = '4.2.0'
|
||||
commonsCompressVersion = '1.20'
|
||||
@@ -51,26 +51,26 @@ ext {
|
||||
googleJsr305Version = '3.0.2'
|
||||
hamcrestVersion = '2.2'
|
||||
hibernateValidationVersion = '8.0.0.Final'
|
||||
jacksonBomVersion = '2.14.2'
|
||||
jaywayJsonPathVersion = '2.7.0'
|
||||
jacksonBomVersion = '2.15.2'
|
||||
jaywayJsonPathVersion = '2.8.0'
|
||||
junit4Version = '4.13.2'
|
||||
junitJupiterVersion = '5.9.2'
|
||||
kotlinCoroutinesVersion = '1.6.4'
|
||||
log4jVersion = '2.19.0'
|
||||
logbackVersion = '1.4.4'
|
||||
junitJupiterVersion = '5.10.0'
|
||||
kotlinCoroutinesVersion = '1.7.3'
|
||||
log4jVersion = '2.20.0'
|
||||
logbackVersion = '1.4.11'
|
||||
lz4Version = '1.8.0'
|
||||
micrometerDocsVersion = '1.0.2'
|
||||
micrometerVersion = '1.10.10'
|
||||
micrometerTracingVersion = '1.0.9'
|
||||
mockitoVersion = '4.8.1'
|
||||
rabbitmqStreamVersion = '0.8.0'
|
||||
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '5.16.1'
|
||||
reactorVersion = '2022.0.10'
|
||||
micrometerVersion = '1.12.0-SNAPSHOT'
|
||||
micrometerTracingVersion = '1.2.0-SNAPSHOT'
|
||||
mockitoVersion = '5.5.0'
|
||||
rabbitmqStreamVersion = '0.12.0'
|
||||
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '5.18.0'
|
||||
reactorVersion = '2023.0.0-SNAPSHOT'
|
||||
snappyVersion = '1.1.8.4'
|
||||
springDataVersion = '2022.0.8'
|
||||
springDataVersion = '2023.1.0-SNAPSHOT'
|
||||
springRetryVersion = '2.0.2'
|
||||
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.11'
|
||||
testcontainersVersion = '1.17.6'
|
||||
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.1.0-SNAPSHOT'
|
||||
testcontainersVersion = '1.19.0'
|
||||
zstdJniVersion = '1.5.0-2'
|
||||
|
||||
javaProjects = subprojects - project(':spring-amqp-bom')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version=3.0.9-SNAPSHOT
|
||||
version=3.1.0-SNAPSHOT
|
||||
org.gradle.jvmargs=-Xms512m -Xmx4g -Dfile.encoding=UTF-8
|
||||
org.gradle.daemon=true
|
||||
org.gradle.caching=true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 the original author or authors.
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -56,6 +56,7 @@ import org.springframework.amqp.support.postprocessor.GUnzipPostProcessor;
|
||||
import org.springframework.amqp.support.postprocessor.GZipPostProcessor;
|
||||
import org.springframework.amqp.utils.test.TestUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
@@ -528,12 +529,16 @@ public class AsyncRabbitTemplateTests {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AsyncRabbitTemplate asyncTemplate(RabbitTemplate template, SimpleMessageListenerContainer container) {
|
||||
public AsyncRabbitTemplate asyncTemplate(@Qualifier("template") RabbitTemplate template,
|
||||
SimpleMessageListenerContainer container) {
|
||||
|
||||
return new AsyncRabbitTemplate(template, container);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AsyncRabbitTemplate asyncDirectTemplate(RabbitTemplate templateForDirect) {
|
||||
public AsyncRabbitTemplate asyncDirectTemplate(
|
||||
@Qualifier("templateForDirect") RabbitTemplate templateForDirect) {
|
||||
|
||||
return new AsyncRabbitTemplate(templateForDirect);
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@@ -409,7 +410,7 @@ public class EnableRabbitIntegrationTests extends NeedsManagementTests {
|
||||
this.rabbitTemplate.setAfterReceivePostProcessors(mpp);
|
||||
assertThat(rabbitTemplate.convertSendAndReceive("multi.exch", "multi.rk", qux)).isEqualTo("QUX: qux: multi.rk");
|
||||
assertThat(beanMethodHeaders).hasSize(2);
|
||||
assertThat(beanMethodHeaders.get(0)).contains("$MultiListenerBean");
|
||||
assertThat(beanMethodHeaders.get(0)).contains("MultiListenerBean");
|
||||
assertThat(beanMethodHeaders.get(1)).isEqualTo("qux");
|
||||
this.rabbitTemplate.removeAfterReceivePostProcessor(mpp);
|
||||
assertThat(rabbitTemplate.convertSendAndReceive("multi.exch.tx", "multi.rk.tx", bar)).isEqualTo("BAR: barbar");
|
||||
@@ -1203,7 +1204,7 @@ public class EnableRabbitIntegrationTests extends NeedsManagementTests {
|
||||
}
|
||||
|
||||
@RabbitListener(queues = "test.header", group = "testGroup", replyPostProcessor = "#{'echoPrefixHeader'}")
|
||||
public String capitalizeWithHeader(@Payload String content, @Header String prefix) {
|
||||
public String capitalizeWithHeader(@Payload String content, @Header("prefix") String prefix) {
|
||||
return prefix + content.toUpperCase();
|
||||
}
|
||||
|
||||
@@ -1213,7 +1214,7 @@ public class EnableRabbitIntegrationTests extends NeedsManagementTests {
|
||||
}
|
||||
|
||||
@RabbitListener(queues = "test.reply")
|
||||
public org.springframework.messaging.Message<?> reply(String payload, @Header String foo,
|
||||
public org.springframework.messaging.Message<?> reply(String payload, @Header("foo") String foo,
|
||||
@Header(AmqpHeaders.CONSUMER_TAG) String tag) {
|
||||
return MessageBuilder.withPayload(payload)
|
||||
.setHeader("foo", foo).setHeader("bar", tag).build();
|
||||
@@ -1677,7 +1678,9 @@ public class EnableRabbitIntegrationTests extends NeedsManagementTests {
|
||||
|
||||
@Bean
|
||||
public SimpleMessageListenerContainer factoryCreatedContainerSimpleListener(
|
||||
@Qualifier("rabbitListenerContainerFactory")
|
||||
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory) {
|
||||
|
||||
SimpleRabbitListenerEndpoint listener = new SimpleRabbitListenerEndpoint();
|
||||
listener.setQueueNames("test.manual.container");
|
||||
listener.setMessageListener((ChannelAwareMessageListener) (message, channel) -> {
|
||||
@@ -1689,6 +1692,7 @@ public class EnableRabbitIntegrationTests extends NeedsManagementTests {
|
||||
|
||||
@Bean
|
||||
public SimpleMessageListenerContainer factoryCreatedContainerNoListener(
|
||||
@Qualifier("rabbitListenerContainerFactory")
|
||||
SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory) {
|
||||
SimpleMessageListenerContainer container = rabbitListenerContainerFactory.createListenerContainer();
|
||||
container.setMessageListener(message -> {
|
||||
@@ -1701,7 +1705,7 @@ public class EnableRabbitIntegrationTests extends NeedsManagementTests {
|
||||
|
||||
@Bean
|
||||
public SimpleRabbitListenerContainerFactory rabbitAutoStartFalseListenerContainerFactory(
|
||||
ReplyPostProcessor rpp) {
|
||||
@Qualifier("rpp") ReplyPostProcessor rpp) {
|
||||
|
||||
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
||||
factory.setConnectionFactory(rabbitConnectionFactory());
|
||||
@@ -2466,14 +2470,14 @@ public class EnableRabbitIntegrationTests extends NeedsManagementTests {
|
||||
|
||||
@RabbitListener(queues = "test.converted.foomessage")
|
||||
public String messagingMessage(org.springframework.messaging.Message<Foo2> message,
|
||||
@Header(value = "", required = false) String h,
|
||||
@Header(value = "notPresent", required = false) String h,
|
||||
@Header(name = AmqpHeaders.RECEIVED_USER_ID) String userId) {
|
||||
return message.getClass().getSimpleName() + message.getPayload().getClass().getSimpleName() + userId;
|
||||
}
|
||||
|
||||
@RabbitListener(queues = "test.notconverted.messagingmessagenotgeneric")
|
||||
public String messagingMessage(@SuppressWarnings("rawtypes") org.springframework.messaging.Message message,
|
||||
@Header(value = "", required = false) Integer h) {
|
||||
@Header(value = "notPresent", required = false) Integer h) {
|
||||
return message.getClass().getSimpleName() + message.getPayload().getClass().getSimpleName();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -465,7 +465,7 @@ public class MethodRabbitListenerEndpointTests {
|
||||
assertThat(message.getPayload()).as("Wrong message payload").isEqualTo("test");
|
||||
}
|
||||
|
||||
public void resolveHeaderAndPayload(@Payload String content, @Header int myCounter,
|
||||
public void resolveHeaderAndPayload(@Payload String content, @Header("myCounter") int myCounter,
|
||||
@Header(AmqpHeaders.CONSUMER_TAG) String tag,
|
||||
@Header(AmqpHeaders.CONSUMER_QUEUE) String queue) {
|
||||
invocations.put("resolveHeaderAndPayload", true);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<bean id="simpleFactory" class="org.springframework.amqp.rabbit.config.RabbitListenerContainerTestFactory"/>
|
||||
|
||||
<bean id="rabbitAdmin" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin"/>
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin" type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<bean id="simpleFactory" class="org.springframework.amqp.rabbit.config.RabbitListenerContainerTestFactory"/>
|
||||
|
||||
<bean id="rabbitAdmin" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin"/>
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitAdmin" type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
<context:property-placeholder
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<rabbit:queue id="foo" ignore-declaration-exceptions="true" declared-by="myAdmin" auto-declare="false"/>
|
||||
|
||||
<bean id="mockFactory" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"/>
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
<rabbit:admin id="myAdmin" connection-factory="mockFactory"/>
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
connection-name-strategy="connectionNameStrategy"/>
|
||||
|
||||
<bean id="connectionNameStrategy" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionNameStrategy"/>
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionNameStrategy"
|
||||
type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
<rabbit:connection-factory id="native" connection-factory="connectionFactory" channel-cache-size="10" />
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
<rabbit:admin id="admin2" auto-startup="false" connection-factory="mockCF" />
|
||||
|
||||
<bean id="mockCF" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" />
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"
|
||||
type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -87,7 +87,8 @@
|
||||
<rabbit:queue id="noAutoDeclare" auto-declare="false" />
|
||||
|
||||
<beans:bean id="mockCF" class="org.mockito.Mockito" factory-method="mock">
|
||||
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" />
|
||||
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"
|
||||
type="java.lang.Class" />
|
||||
</beans:bean>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -75,7 +75,8 @@
|
||||
<rabbit:queue id="noAutoDeclare" auto-declare="false" />
|
||||
|
||||
<beans:bean id="mockCF" class="org.mockito.Mockito" factory-method="mock">
|
||||
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory" />
|
||||
<beans:constructor-arg value="org.springframework.amqp.rabbit.connection.ConnectionFactory"
|
||||
type="java.lang.Class"/>
|
||||
</beans:bean>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -42,17 +42,19 @@
|
||||
receive-connection-factory-selector-expression="'foo'"/>
|
||||
|
||||
<bean id="rcb" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ReturnsCallback"/>
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ReturnsCallback"
|
||||
type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
<bean id="ccb" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ConfirmCallback"/>
|
||||
<constructor-arg value="org.springframework.amqp.rabbit.core.RabbitTemplate$ConfirmCallback"
|
||||
type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
<bean id="retrier" class="org.springframework.retry.support.RetryTemplate"/>
|
||||
|
||||
<bean id="recoverer" class="org.mockito.Mockito" factory-method="mock">
|
||||
<constructor-arg value="org.springframework.retry.RecoveryCallback"/>
|
||||
<constructor-arg value="org.springframework.retry.RecoveryCallback" type="java.lang.Class"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user