Skip to content

Commit 8abd72d

Browse files
committed
Upgrade dependencies; fix problems
* Mockito doesn't allow to `spy()` mocks any more or "overspy" * Deprecate `KotlinScriptExecutor` if favor of fully supported JSR223 service loaded via `DefaultScriptExecutor` * Use only one `kotlin-scripting-jsr223` dependency
1 parent a147040 commit 8abd72d

File tree

7 files changed

+44
-60
lines changed

7 files changed

+44
-60
lines changed

build.gradle

+30-35
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlinVersion = '1.8.10'
2+
ext.kotlinVersion = '1.8.20'
33
ext.isCI = System.getenv('GITHUB_ACTION') || System.getenv('bamboo_buildKey')
44
repositories {
55
gradlePluginPortal()
@@ -15,11 +15,11 @@ buildscript {
1515
}
1616

1717
plugins {
18-
id 'org.sonarqube' version '4.2.0.3129'
18+
id 'org.sonarqube' version '4.2.1.3168'
1919
id 'io.spring.nohttp' version '0.0.11' apply false
2020
id 'org.ajoberstar.grgit' version '4.1.1'
2121
id 'io.spring.dependency-management' version '1.1.0'
22-
id 'com.jfrog.artifactory' version '4.31.9' apply false
22+
id 'com.jfrog.artifactory' version '4.32.0' apply false
2323
id 'org.jetbrains.dokka' version "$kotlinVersion"
2424
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
2525
id 'org.asciidoctor.jvm.gems' version '3.3.2'
@@ -48,32 +48,32 @@ ext {
4848
modifiedFiles =
4949
files(grgit.status().unstaged.modified).filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
5050

51-
apacheSshdVersion = '2.9.2'
52-
artemisVersion = '2.28.0'
51+
apacheSshdVersion = '2.10.0'
52+
artemisVersion = '2.29.0'
5353
aspectjVersion = '1.9.19'
5454
assertjVersion = '3.24.2'
55-
assertkVersion = '0.26'
55+
assertkVersion = '0.26.1'
5656
avroVersion = '1.11.1'
5757
awaitilityVersion = '4.2.0'
58-
camelVersion = '3.20.4'
58+
camelVersion = '3.20.6'
5959
commonsDbcp2Version = '2.9.0'
6060
commonsIoVersion = '2.11.0'
6161
commonsNetVersion = '3.9.0'
6262
curatorVersion = '5.5.0'
63-
debeziumVersion = '2.3.0.CR1'
63+
debeziumVersion = '2.3.0.Final'
6464
derbyVersion = '10.16.1.1'
6565
findbugsVersion = '3.0.1'
6666
ftpServerVersion = '1.2.0'
67-
graalvmVersion = '22.3.2'
67+
graalvmVersion = '23.0.0'
6868
greenmailVersion = '2.1.0-alpha-1'
6969
groovyVersion = '4.0.12'
7070
hamcrestVersion = '2.2'
71-
hazelcastVersion = '5.2.3'
72-
hibernateVersion = '6.2.2.Final'
73-
hsqldbVersion = '2.7.1'
71+
hazelcastVersion = '5.3.1'
72+
hibernateVersion = '6.2.5.Final'
73+
hsqldbVersion = '2.7.2'
7474
h2Version = '2.1.214'
75-
jacksonVersion = '2.15.0'
76-
jaxbVersion = '4.0.2'
75+
jacksonVersion = '2.15.2'
76+
jaxbVersion = '4.0.3'
7777
jcifsVersion = '2.1.34'
7878
jeroMqVersion = '0.5.3'
7979
jmsApiVersion = '3.1.0'
@@ -88,31 +88,31 @@ ext {
8888
lettuceVersion = '6.2.4.RELEASE'
8989
log4jVersion = '2.20.0'
9090
mailVersion = '2.0.2'
91-
micrometerTracingVersion = '1.1.1'
92-
micrometerVersion = '1.11.0'
93-
mockitoVersion = '5.3.1'
91+
micrometerTracingVersion = '1.1.2'
92+
micrometerVersion = '1.11.1'
93+
mockitoVersion = '5.4.0'
9494
mongoDriverVersion = '4.9.1'
9595
mysqlVersion = '8.0.33'
9696
pahoMqttClientVersion = '1.2.5'
9797
postgresVersion = '42.6.0'
98-
protobufVersion = '3.23.0'
98+
protobufVersion = '3.23.3'
9999
r2dbch2Version = '1.0.0.RELEASE'
100-
reactorVersion = '2022.0.7'
100+
reactorVersion = '2022.0.8'
101101
resilience4jVersion = '2.0.2'
102102
romeToolsVersion = '2.1.0'
103-
rsocketVersion = '1.1.3'
103+
rsocketVersion = '1.1.4'
104104
servletApiVersion = '6.0.0'
105105
smackVersion = '4.4.6'
106-
springAmqpVersion = '3.0.4'
107-
springDataVersion = '2023.0.0'
108-
springGraphqlVersion = '1.2.0'
109-
springKafkaVersion = '3.0.7'
110-
springRetryVersion = '2.0.1'
111-
springSecurityVersion = '6.1.0'
106+
springAmqpVersion = '3.0.5'
107+
springDataVersion = '2023.0.1'
108+
springGraphqlVersion = '1.2.1'
109+
springKafkaVersion = '3.0.8'
110+
springRetryVersion = '2.0.2'
111+
springSecurityVersion = '6.1.1'
112112
springVersion = '6.1.0-SNAPSHOT'
113113
springWsVersion = '4.0.4'
114-
testcontainersVersion = '1.18.1'
115-
tomcatVersion = '10.1.8'
114+
testcontainersVersion = '1.18.3'
115+
tomcatVersion = '10.1.10'
116116
xmlUnitVersion = '2.9.1'
117117
xstreamVersion = '1.4.20'
118118
ztZipVersion = '1.15'
@@ -366,7 +366,7 @@ configure(javaProjects) { subproject ->
366366

367367
checkstyle {
368368
configDirectory.set(rootProject.file('src/checkstyle'))
369-
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '10.11.0'
369+
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '10.12.0'
370370
}
371371

372372
jar {
@@ -884,18 +884,13 @@ project('spring-integration-scripting') {
884884
description = 'Spring Integration Scripting Support'
885885
dependencies {
886886
api project(':spring-integration-core')
887-
optionalApi ('org.jetbrains.kotlin:kotlin-script-util') {
888-
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-daemon-client'
889-
}
890-
optionalApi 'org.jetbrains.kotlin:kotlin-compiler-embeddable'
887+
optionalApi 'org.jetbrains.kotlin:kotlin-scripting-jsr223'
891888
providedImplementation "org.graalvm.sdk:graal-sdk:$graalvmVersion"
892889
providedImplementation "org.graalvm.js:js:$graalvmVersion"
893890

894891
testImplementation "org.jruby:jruby-complete:$jrubyVersion"
895892
testImplementation 'org.apache.groovy:groovy-jsr223'
896893
testImplementation "org.python:jython-standalone:$jythonVersion"
897-
898-
testRuntimeOnly 'org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable'
899894
}
900895

901896
tasks.withType(JavaForkOptions) {

spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/BoundRabbitChannelAdviceTests.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2022 the original author or authors.
2+
* Copyright 2018-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.
@@ -44,7 +44,6 @@
4444
import static org.mockito.BDDMockito.given;
4545
import static org.mockito.BDDMockito.willAnswer;
4646
import static org.mockito.Mockito.mock;
47-
import static org.mockito.Mockito.spy;
4847
import static org.mockito.Mockito.times;
4948
import static org.mockito.Mockito.verify;
5049

@@ -96,7 +95,6 @@ public static class Config {
9695
public CachingConnectionFactory cf() throws Exception {
9796
ConnectionFactory cf = mock(ConnectionFactory.class);
9897
cf.setHost("localhost");
99-
cf = spy(cf);
10098
willAnswer(i -> {
10199
this.connection = mock(Connection.class);
102100
willAnswer(ii -> {

spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2022 the original author or authors.
2+
* Copyright 2018-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.
@@ -576,7 +576,7 @@ void testNackWithLaterInflight() {
576576
ack1.acknowledge(AcknowledgmentCallback.Status.REQUEUE);
577577
assertThat(received2.getHeaders().get(KafkaHeaders.OFFSET)).isEqualTo(1L);
578578
AcknowledgmentCallback ack2 = StaticMessageHeaderAccessor.getAcknowledgmentCallback(received2);
579-
Log log2 = spy(KafkaTestUtils.getPropertyValue(ack1, "logger.log", Log.class));
579+
Log log2 = spy(KafkaTestUtils.getPropertyValue(ack2, "logger.log", Log.class));
580580
new DirectFieldAccessor(ack2).setPropertyValue("logger.log", log2);
581581
given(log2.isWarnEnabled()).willReturn(true);
582582
willDoNothing().given(log2).warn(any());

spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/KotlinScriptExecutor.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 the original author or authors.
2+
* Copyright 2019-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.
@@ -18,29 +18,24 @@
1818

1919
import javax.script.Bindings;
2020
import javax.script.ScriptEngine;
21-
22-
import org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngineFactory;
21+
import javax.script.ScriptEngineManager;
2322

2423

2524
/**
2625
* An {@link AbstractScriptExecutor} for the Kotlin scripts support.
27-
* Uses {@link KotlinJsr223JvmLocalScriptEngineFactory} directly since there is
28-
* no {@code META-INF/services/javax.script.ScriptEngineFactory} file in CLASSPATH.
29-
* Also sets an {@code idea.use.native.fs.for.win} system property to {@code false}
30-
* to disable a native engine discovery for Windows: bay be resolved in the future Kotlin versions.
3126
*
3227
* @author Artem Bilan
3328
*
3429
* @since 5.2
30+
*
31+
* @deprecated since 6.2 in favor of {@link DefaultScriptExecutor} with {@code kotlin}
32+
* as an argument.
3533
*/
34+
@Deprecated(since = "6.2", forRemoval = true)
3635
public class KotlinScriptExecutor extends AbstractScriptExecutor {
3736

38-
static {
39-
System.setProperty("idea.use.native.fs.for.win", "false");
40-
}
41-
4237
public KotlinScriptExecutor() {
43-
super(new KotlinJsr223JvmLocalScriptEngineFactory().getScriptEngine());
38+
super(new ScriptEngineManager().getEngineByName("kotlin"));
4439
}
4540

4641
@Override

spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutorFactory.java

+1-4
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.
@@ -40,9 +40,6 @@ public static ScriptExecutor getScriptExecutor(String language) {
4040
else if (language.equalsIgnoreCase("ruby") || language.equalsIgnoreCase("jruby")) {
4141
return new RubyScriptExecutor();
4242
}
43-
else if (language.equalsIgnoreCase("kotlin")) {
44-
return new KotlinScriptExecutor();
45-
}
4643
else if (language.equalsIgnoreCase("js") || language.equalsIgnoreCase("javascript")) {
4744
return new PolyglotScriptExecutor("js");
4845
}

spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/DeriveLanguageFromExtensionTests.java

+2-2
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.
@@ -48,7 +48,7 @@ public void testParseLanguage() {
4848
RubyScriptExecutor.class,
4949
DefaultScriptExecutor.class,
5050
PythonScriptExecutor.class,
51-
KotlinScriptExecutor.class
51+
DefaultScriptExecutor.class
5252
};
5353

5454
Map<String, ScriptExecutingMessageProcessor> scriptProcessors =

spring-integration-test/src/test/java/org/springframework/integration/test/mock/MockMessageHandlerTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
6262
import static org.assertj.core.api.Assertions.fail;
6363
import static org.mockito.ArgumentMatchers.any;
64-
import static org.mockito.Mockito.spy;
6564
import static org.mockito.Mockito.verify;
6665
import static org.springframework.integration.test.mock.MockIntegration.mockMessageHandler;
6766

@@ -187,7 +186,7 @@ public void testMockMessageHandlerPojoService() {
187186
public void testMockRawHandler() {
188187
ArgumentCaptor<Message<?>> messageArgumentCaptor = MockIntegration.messageArgumentCaptor();
189188
MessageHandler mockMessageHandler =
190-
spy(mockMessageHandler(messageArgumentCaptor))
189+
mockMessageHandler(messageArgumentCaptor)
191190
.handleNext(m -> {
192191
});
193192

0 commit comments

Comments
 (0)