Skip to content

Commit c157b9b

Browse files
committed
Upgrade some deps; fix deprecations
1 parent 50bf00e commit c157b9b

File tree

6 files changed

+64
-54
lines changed

6 files changed

+64
-54
lines changed

build.gradle

+14-14
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ plugins {
1919
id 'org.sonarqube' version '4.3.0.3225'
2020
id 'io.spring.nohttp' version '0.0.11' apply false
2121
id 'org.ajoberstar.grgit' version '4.1.1'
22-
id 'io.spring.dependency-management' version '1.1.2'
23-
id 'com.jfrog.artifactory' version '4.33.1' apply false
22+
id 'io.spring.dependency-management' version '1.1.3'
23+
id 'com.jfrog.artifactory' version '5.0.3' apply false
2424
id 'org.jetbrains.dokka' version '1.8.20'
2525
id 'org.antora' version '1.0.0'
2626
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
@@ -45,8 +45,8 @@ ext {
4545
linkScmConnection = 'scm:git:git://github.com/spring-projects/spring-integration.git'
4646
linkScmDevConnection = 'scm:git:ssh://[email protected]:spring-projects/spring-integration.git'
4747

48-
modifiedFiles = providers.provider {
49-
files(grgit.status().unstaged.modified).filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') } }
48+
modifiedFiles =
49+
files(grgit.status().unstaged.modified).filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
5050

5151
apacheSshdVersion = '2.10.0'
5252
artemisVersion = '2.29.0'
@@ -55,7 +55,7 @@ ext {
5555
assertkVersion = '0.26.1'
5656
avroVersion = '1.11.2'
5757
awaitilityVersion = '4.2.0'
58-
camelVersion = '4.0.0-RC1'
58+
camelVersion = '4.0.0-RC2'
5959
commonsDbcp2Version = '2.9.0'
6060
commonsIoVersion = '2.13.0'
6161
commonsNetVersion = '3.9.0'
@@ -81,35 +81,35 @@ ext {
8181
jrubyVersion = '9.4.3.0'
8282
jsonpathVersion = '2.8.0'
8383
junit4Version = '4.13.2'
84-
junitJupiterVersion = '5.10.0-RC1'
84+
junitJupiterVersion = '5.10.0'
8585
jythonVersion = '2.7.3'
8686
kotlinCoroutinesVersion = '1.7.2'
8787
kryoVersion = '5.5.0'
8888
lettuceVersion = '6.2.4.RELEASE'
8989
log4jVersion = '2.20.0'
9090
mailVersion = '2.0.2'
91-
micrometerTracingVersion = '1.2.0-M1'
92-
micrometerVersion = '1.12.0-M1'
91+
micrometerTracingVersion = '1.2.0-SNAPSHOT'
92+
micrometerVersion = '1.12.0-SNAPSHOT'
9393
mockitoVersion = '5.4.0'
9494
mongoDriverVersion = '4.10.2'
9595
mysqlVersion = '8.0.33'
9696
pahoMqttClientVersion = '1.2.5'
9797
postgresVersion = '42.6.0'
98-
protobufVersion = '3.24.0-RC1'
98+
protobufVersion = '3.24.0-RC2'
9999
r2dbch2Version = '1.0.0.RELEASE'
100-
reactorVersion = '2023.0.0-M1'
100+
reactorVersion = '2023.0.0-SNAPSHOT'
101101
resilience4jVersion = '2.1.0'
102102
romeToolsVersion = '2.1.0'
103103
rsocketVersion = '1.1.4'
104104
servletApiVersion = '6.0.0'
105105
smackVersion = '4.4.6'
106106
springAmqpVersion = '3.0.6'
107-
springDataVersion = '2023.1.0-M1'
107+
springDataVersion = '2023.1.0-SNAPSHOT'
108108
springGraphqlVersion = '1.2.2'
109109
springKafkaVersion = '3.0.10-SNAPSHOT'
110110
springRetryVersion = '2.0.2'
111-
springSecurityVersion = '6.2.0-M1'
112-
springVersion = '6.1.0-M2'
111+
springSecurityVersion = '6.2.0-SNAPSHOT'
112+
springVersion = '6.1.0-SNAPSHOT'
113113
springWsVersion = '4.0.4'
114114
testcontainersVersion = '1.18.3'
115115
tomcatVersion = '10.1.11'
@@ -290,7 +290,7 @@ configure(javaProjects) { subproject ->
290290

291291
tasks.register('updateCopyrights') {
292292
onlyIf { !isCI }
293-
inputs.files(modifiedFiles.map(files -> files.filter { f -> f.path.contains(subproject.name) }))
293+
inputs.files(modifiedFiles.filter { f -> f.path.contains(subproject.name) })
294294
outputs.dir('build/classes')
295295

296296
doLast {

gradle/docs.gradle

+11-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ ext {
66
antora {
77
version = '3.2.0-alpha.2'
88
playbook = file('src/reference/antora/antora-playbook.yml')
9-
options = ['to-dir' : project.layout.buildDirectory.dir('site').get().toString(), clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
9+
options = [
10+
'to-dir' : project.layout.buildDirectory.dir('site').get().toString(),
11+
clean: true,
12+
fetch: !project.gradle.startParameter.offline,
13+
stacktrace: true
14+
]
1015
dependencies = [
11-
'@antora/atlas-extension': '1.0.0-alpha.1',
16+
'@antora/atlas-extension': '1.0.0-alpha.2',
1217
'@antora/collector-extension': '1.0.0-alpha.3',
13-
'@asciidoctor/tabs': '1.0.0-beta.3',
14-
'@springio/antora-extensions': '1.4.2',
15-
'@springio/asciidoctor-extensions': '1.0.0-alpha.8',
18+
'@asciidoctor/tabs': '1.0.0-beta.6',
19+
'@springio/antora-extensions': '1.5.0',
20+
'@springio/asciidoctor-extensions': '1.0.0-alpha.9',
1621
]
1722
}
1823

19-
tasks.named("generateAntoraYml") {
24+
tasks.named('generateAntoraYml') {
2025
asciidocAttributes = project.provider( {
2126
return ['project-version' : project.version ]
2227
} )

settings.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id 'com.gradle.enterprise' version '3.13.4'
3-
id 'io.spring.ge.conventions' version '0.0.13'
2+
id 'com.gradle.enterprise' version '3.14.1'
3+
id 'io.spring.ge.conventions' version '0.0.14'
44
}
55

66
rootProject.name = 'spring-integration'

spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,9 +27,9 @@
2727

2828
import org.apache.commons.logging.Log;
2929
import org.apache.commons.logging.LogFactory;
30-
import org.junit.Before;
31-
import org.junit.Ignore;
32-
import org.junit.Test;
30+
import org.junit.jupiter.api.BeforeEach;
31+
import org.junit.jupiter.api.Disabled;
32+
import org.junit.jupiter.api.Test;
3333

3434
import org.springframework.beans.factory.BeanFactory;
3535
import org.springframework.integration.channel.DirectChannel;
@@ -50,6 +50,7 @@
5050
import org.springframework.util.StopWatch;
5151

5252
import static org.assertj.core.api.Assertions.assertThat;
53+
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
5354
import static org.mockito.Mockito.mock;
5455

5556
/**
@@ -69,7 +70,7 @@ public class AggregatorTests {
6970

7071
private final List<MessageGroupExpiredEvent> expiryEvents = new ArrayList<>();
7172

72-
@Before
73+
@BeforeEach
7374
public void configureAggregator() {
7475
this.aggregator = new AggregatingMessageHandler(new MultiplyingProcessor(), store);
7576
this.aggregator.setBeanFactory(mock(BeanFactory.class));
@@ -80,7 +81,7 @@ public void configureAggregator() {
8081
}
8182

8283
@Test
83-
@Ignore
84+
@Disabled
8485
public void testAggPerf() throws InterruptedException, ExecutionException, TimeoutException {
8586
AggregatingMessageHandler handler = new AggregatingMessageHandler(new DefaultAggregatingMessageGroupProcessor());
8687
handler.setCorrelationStrategy(message -> "foo");
@@ -170,7 +171,7 @@ public void testAggPerfDefaultPartial() throws InterruptedException, ExecutionEx
170171
}
171172
stopwatch.stop();
172173
logger.warn("Sent " + 120000 + " in " + stopwatch.getTotalTimeSeconds() +
173-
" (10k in " + stopwatch.getLastTaskTimeMillis() + "ms)");
174+
" (10k in " + stopwatch.lastTaskInfo().getTimeMillis() + "ms)");
174175

175176
Collection<?> result = resultFuture.get(10, TimeUnit.SECONDS);
176177
assertThat(result).isNotNull();
@@ -186,7 +187,7 @@ class CustomHandler extends AbstractMessageHandler {
186187

187188
private final ReentrantLock lock = new ReentrantLock();
188189

189-
private final Collection<Message<?>> messages = new ArrayList<Message<?>>(60000);
190+
private final Collection<Message<?>> messages = new ArrayList<>(60000);
190191

191192
private final MessageChannel outputChannel;
192193

@@ -233,14 +234,14 @@ public void handleMessageInternal(Message<?> requestMessage) {
233234
if (i % 10000 == 0) {
234235
stopwatch.stop();
235236
logger.warn("Sent " + i + " in " + stopwatch.getTotalTimeSeconds() +
236-
" (10k in " + stopwatch.getLastTaskTimeMillis() + "ms)");
237+
" (10k in " + stopwatch.lastTaskInfo().getTimeMillis() + "ms)");
237238
stopwatch.start();
238239
}
239240
handler.handleMessage(message);
240241
}
241242
stopwatch.stop();
242243
logger.warn("Sent " + 120000 + " in " + stopwatch.getTotalTimeSeconds() +
243-
" (10k in " + stopwatch.getLastTaskTimeMillis() + "ms)");
244+
" (10k in " + stopwatch.lastTaskInfo().getTimeMillis() + "ms)");
244245

245246
Collection<?> result = resultFuture.get(10, TimeUnit.SECONDS);
246247
assertThat(result).isNotNull();
@@ -465,7 +466,7 @@ public void testMultipleGroupsSimultaneously() {
465466
}
466467

467468
@Test
468-
@Ignore
469+
@Disabled
469470
// dropped backwards compatibility for setting capacity limit (it's always Integer.MAX_VALUE)
470471
public void testTrackedCorrelationIdsCapacityAtLimit() {
471472
QueueChannel replyChannel = new QueueChannel();
@@ -484,7 +485,7 @@ public void testTrackedCorrelationIdsCapacityAtLimit() {
484485
}
485486

486487
@Test
487-
@Ignore
488+
@Disabled
488489
// dropped backwards compatibility for setting capacity limit (it's always Integer.MAX_VALUE)
489490
public void testTrackedCorrelationIdsCapacityPassesLimit() {
490491
QueueChannel replyChannel = new QueueChannel();
@@ -504,10 +505,11 @@ public void testTrackedCorrelationIdsCapacityPassesLimit() {
504505
assertThat(discardChannel.receive(0)).isNull();
505506
}
506507

507-
@Test(expected = MessageHandlingException.class)
508+
@Test
508509
public void testExceptionThrownIfNoCorrelationId() throws InterruptedException {
509510
Message<?> message = createMessage(3, null, 2, 1, new QueueChannel(), null);
510-
this.aggregator.handleMessage(message);
511+
assertThatExceptionOfType(MessageHandlingException.class)
512+
.isThrownBy(() -> this.aggregator.handleMessage(message));
511513
}
512514

513515
@Test

spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionFactoryShutDownTests.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020
import java.util.concurrent.Executor;
2121
import java.util.concurrent.TimeUnit;
2222

23-
import org.junit.Test;
23+
import org.junit.jupiter.api.Test;
2424

2525
import org.springframework.messaging.MessagingException;
2626
import org.springframework.util.StopWatch;
@@ -70,7 +70,8 @@ public TcpConnection getConnection() {
7070
watch.start();
7171
factory.stop();
7272
watch.stop();
73-
assertThat(watch.getLastTaskTimeMillis() < 10000).as("Expected < 10000, was: " + watch.getLastTaskTimeMillis())
73+
assertThat(watch.lastTaskInfo().getTimeMillis() < 10000)
74+
.as("Expected < 10000, was: " + watch.lastTaskInfo().getTimeMillis())
7475
.isTrue();
7576
assertThat(latch1.await(10, TimeUnit.SECONDS)).isTrue();
7677
}

spring-integration-kafka/src/main/java/org/springframework/integration/kafka/inbound/KafkaMessageSource.java

+17-15
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import org.springframework.kafka.listener.ConsumerAwareRebalanceListener;
6262
import org.springframework.kafka.listener.ConsumerProperties;
6363
import org.springframework.kafka.listener.ErrorHandlingUtils;
64-
import org.springframework.kafka.listener.ListenerUtils;
6564
import org.springframework.kafka.listener.LoggingCommitCallback;
6665
import org.springframework.kafka.support.Acknowledgment;
6766
import org.springframework.kafka.support.DefaultKafkaHeaderMapper;
@@ -281,7 +280,6 @@ protected void onInit() {
281280
this.consumerProperties.setClientId(getComponentName());
282281
}
283282

284-
Map<String, Object> props = this.consumerFactory.getConfigurationProperties();
285283
Properties kafkaConsumerProperties = this.consumerProperties.getKafkaConsumerProperties();
286284
this.checkNullKeyForExceptions =
287285
this.consumerProperties.isCheckDeserExWhenKeyNull() ||
@@ -390,16 +388,7 @@ private ConsumerFactory<K, V> fixOrRejectConsumerFactory(ConsumerFactory<K, V> s
390388
this.logger.warn(() -> ConsumerConfig.MAX_POLL_RECORDS_CONFIG
391389
+ "' has been forced from " + (maxPoll == null ? "unspecified" : maxPoll)
392390
+ " to 1, to avoid having to seek after each record");
393-
Map<String, Object> configs = new HashMap<>(suppliedConsumerFactory.getConfigurationProperties());
394-
configs.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1);
395-
DefaultKafkaConsumerFactory<K, V> fixedConsumerFactory = new DefaultKafkaConsumerFactory<>(configs);
396-
if (suppliedConsumerFactory.getKeyDeserializer() != null) {
397-
fixedConsumerFactory.setKeyDeserializer(suppliedConsumerFactory.getKeyDeserializer());
398-
}
399-
if (suppliedConsumerFactory.getValueDeserializer() != null) {
400-
fixedConsumerFactory.setValueDeserializer(suppliedConsumerFactory.getValueDeserializer());
401-
}
402-
return fixedConsumerFactory;
391+
return fixConsumerFactory(suppliedConsumerFactory);
403392
}
404393
else {
405394
return suppliedConsumerFactory;
@@ -494,7 +483,7 @@ protected Object doReceive() {
494483
createConsumer();
495484
this.running = true;
496485
}
497-
if (this.pausing && !this.paused && this.assignedPartitions.size() > 0) {
486+
if (this.pausing && !this.paused && !this.assignedPartitions.isEmpty()) {
498487
this.consumer.pause(this.assignedPartitions);
499488
this.paused = true;
500489
}
@@ -675,8 +664,8 @@ private Object recordToMessage(ConsumerRecord<K, V> record) {
675664
}
676665
}
677666

678-
private void checkDeserializationException(ConsumerRecord<K, V> cRecord, String headerName) {
679-
DeserializationException exception = ListenerUtils.getExceptionFromHeader(cRecord, headerName, this.logger);
667+
private void checkDeserializationException(ConsumerRecord<K, V> record, String headerName) {
668+
DeserializationException exception = SerializationUtils.getExceptionFromHeader(record, headerName, this.logger);
680669
if (exception != null) {
681670
throw exception;
682671
}
@@ -707,6 +696,19 @@ private void stopConsumer() {
707696
}
708697
}
709698

699+
private static <K, V> ConsumerFactory<K, V> fixConsumerFactory(ConsumerFactory<K, V> suppliedConsumerFactory) {
700+
Map<String, Object> configs = new HashMap<>(suppliedConsumerFactory.getConfigurationProperties());
701+
configs.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1);
702+
DefaultKafkaConsumerFactory<K, V> fixedConsumerFactory = new DefaultKafkaConsumerFactory<>(configs);
703+
if (suppliedConsumerFactory.getKeyDeserializer() != null) {
704+
fixedConsumerFactory.setKeyDeserializer(suppliedConsumerFactory.getKeyDeserializer());
705+
}
706+
if (suppliedConsumerFactory.getValueDeserializer() != null) {
707+
fixedConsumerFactory.setValueDeserializer(suppliedConsumerFactory.getValueDeserializer());
708+
}
709+
return fixedConsumerFactory;
710+
}
711+
710712
private class IntegrationConsumerRebalanceListener implements ConsumerRebalanceListener {
711713

712714
private final ConsumerRebalanceListener providedRebalanceListener;

0 commit comments

Comments
 (0)