Skip to content

Commit 19e53a9

Browse files
committed
Upgrade dependencies; prepare for release
* Migrate `MBeanTreePollingChannelAdapterParserTests` to JUnit 5
1 parent 60b355b commit 19e53a9

File tree

2 files changed

+67
-63
lines changed

2 files changed

+67
-63
lines changed

build.gradle

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ ext {
4646
modifiedFiles =
4747
files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
4848

49-
activeMqVersion = '5.16.1'
50-
apacheSshdVersion = '2.6.0'
49+
activeMqVersion = '5.16.2'
50+
apacheSshdVersion = '2.7.0'
5151
aspectjVersion = '1.9.6'
52-
assertjVersion = '3.19.0'
52+
assertjVersion = '3.20.2'
5353
assertkVersion = '0.24'
5454
avroVersion = '1.10.2'
55-
awaitilityVersion = '4.0.3'
55+
awaitilityVersion = '4.1.0'
5656
commonsDbcp2Version = '2.8.0'
57-
commonsIoVersion = '2.8.0'
57+
commonsIoVersion = '2.10.0'
5858
commonsNetVersion = '3.8.0'
5959
curatorVersion = '4.3.0'
6060
derbyVersion = '10.14.2.0'
@@ -64,7 +64,7 @@ ext {
6464
groovyVersion = '3.0.8'
6565
hamcrestVersion = '2.2'
6666
hazelcastVersion = '4.2'
67-
hibernateVersion = '5.4.31.Final'
67+
hibernateVersion = '5.5.3.Final'
6868
hsqldbVersion = '2.6.0'
6969
h2Version = '1.4.200'
7070
jacksonVersion = '2.12.3'
@@ -73,39 +73,39 @@ ext {
7373
jeroMqVersion = '0.5.2'
7474
jmsApiVersion = '2.0.1'
7575
jpaApiVersion = '2.7.7'
76-
jrubyVersion = '9.2.17.0'
76+
jrubyVersion = '9.2.19.0'
7777
jschVersion = '0.1.55'
78-
jsonpathVersion = '2.5.0'
78+
jsonpathVersion = '2.6.0'
7979
junit4Version = '4.13.2'
8080
junitJupiterVersion = '5.7.2'
8181
jythonVersion = '2.7.2'
8282
kryoShadedVersion = '4.0.2'
83-
lettuceVersion = '6.1.2.RELEASE'
83+
lettuceVersion = '6.1.3.RELEASE'
8484
log4jVersion = '2.14.1'
8585
mailVersion = '1.6.7'
86-
micrometerVersion = '1.7.0'
87-
mockitoVersion = '3.10.0'
86+
micrometerVersion = '1.7.1'
87+
mockitoVersion = '3.11.2'
8888
mongoDriverVersion = '4.2.3'
89-
mysqlVersion = '8.0.23'
89+
mysqlVersion = '8.0.25'
9090
pahoMqttClientVersion = '1.2.5'
91-
postgresVersion = '42.2.19'
91+
postgresVersion = '42.2.22'
9292
r2dbch2Version='0.8.4.RELEASE'
9393
reactorVersion = '2020.0.7'
9494
resilience4jVersion = '1.7.0'
9595
romeToolsVersion = '1.15.0'
96-
rsocketVersion = '1.1.0'
96+
rsocketVersion = '1.1.1'
9797
saajVersion = '1.5.2'
9898
servletApiVersion = '4.0.1'
9999
smackVersion = '4.3.5'
100100
soapVersion = '1.4.0'
101-
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.3.7'
102-
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2021.0.1'
103-
springKafkaVersion = '2.7.2-SNAPSHOT'
101+
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.3.9'
102+
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2021.0.2'
103+
springKafkaVersion = '2.7.3'
104104
springRetryVersion = '1.3.1'
105-
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.5.0'
106-
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.3.7'
105+
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.5.1'
106+
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.3.8'
107107
springWsVersion = '3.1.1'
108-
tomcatVersion = '9.0.46'
108+
tomcatVersion = '9.0.48'
109109
xmlUnitVersion = '2.8.2'
110110
xstreamVersion = '1.4.17'
111111

@@ -223,7 +223,7 @@ configure(javaProjects) { subproject ->
223223
}
224224

225225
jacoco {
226-
toolVersion = '0.8.6'
226+
toolVersion = '0.8.7'
227227
}
228228

229229
// dependencies that are common across all java projects
@@ -342,7 +342,7 @@ configure(javaProjects) { subproject ->
342342

343343
checkstyle {
344344
configDirectory.set(rootProject.file('src/checkstyle'))
345-
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '8.42'
345+
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '8.43'
346346
}
347347

348348
jar {

spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/MBeanTreePollingChannelAdapterParserTests.java

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2019 the original author or authors.
2+
* Copyright 2013-2021 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.
@@ -24,8 +24,7 @@
2424
import javax.management.ObjectName;
2525
import javax.management.QueryExp;
2626

27-
import org.junit.Test;
28-
import org.junit.runner.RunWith;
27+
import org.junit.jupiter.api.Test;
2928

3029
import org.springframework.beans.factory.annotation.Autowired;
3130
import org.springframework.beans.factory.annotation.Qualifier;
@@ -35,17 +34,15 @@
3534
import org.springframework.messaging.Message;
3635
import org.springframework.messaging.PollableChannel;
3736
import org.springframework.test.annotation.DirtiesContext;
38-
import org.springframework.test.context.ContextConfiguration;
39-
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
37+
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
4038

4139
/**
4240
* @author Stuart Williams
4341
* @author Gary Russell
4442
* @author Artem Bilan
4543
*
4644
*/
47-
@ContextConfiguration
48-
@RunWith(SpringJUnit4ClassRunner.class)
45+
@SpringJUnitConfig
4946
@DirtiesContext
5047
public class MBeanTreePollingChannelAdapterParserTests {
5148

@@ -103,39 +100,39 @@ public class MBeanTreePollingChannelAdapterParserTests {
103100
private final long testTimeout = 20000L;
104101

105102
@Test
106-
public void pollDefaultAdapter() throws Exception {
103+
public void pollDefaultAdapter() {
107104
adapterDefault.start();
108105

109106
Message<?> result = channel1.receive(testTimeout);
110-
assertThat(result).isNotNull();
111-
112-
assertThat(result.getPayload().getClass()).isEqualTo(HashMap.class);
107+
assertThat(result)
108+
.isNotNull()
109+
.extracting(Message::getPayload)
110+
.isInstanceOf(HashMap.class);
113111

114112
@SuppressWarnings("unchecked")
115113
Map<String, Object> beans = (Map<String, Object>) result.getPayload();
116114

117115
// test for a couple of MBeans
118-
assertThat(beans.containsKey("java.lang:type=OperatingSystem")).isTrue();
119-
assertThat(beans.containsKey("java.lang:type=Runtime")).isTrue();
116+
assertThat(beans).containsKeys("java.lang:type=OperatingSystem", "java.lang:type=Runtime");
120117

121118
adapterDefault.stop();
122119
}
123120

124121
@Test
125-
public void pollInnerAdapter() throws Exception {
122+
public void pollInnerAdapter() {
126123
adapterInner.start();
127124

128125
Message<?> result = channel2.receive(testTimeout);
129-
assertThat(result).isNotNull();
130-
131-
assertThat(result.getPayload().getClass()).isEqualTo(HashMap.class);
126+
assertThat(result)
127+
.isNotNull()
128+
.extracting(Message::getPayload)
129+
.isInstanceOf(HashMap.class);
132130

133131
@SuppressWarnings("unchecked")
134132
Map<String, Object> beans = (Map<String, Object>) result.getPayload();
135133

136134
// test for a couple of MBeans
137-
assertThat(beans.containsKey("java.lang:type=OperatingSystem")).isTrue();
138-
assertThat(beans.containsKey("java.lang:type=Runtime")).isTrue();
135+
assertThat(beans).containsKeys("java.lang:type=OperatingSystem", "java.lang:type=Runtime");
139136

140137
adapterInner.stop();
141138
}
@@ -151,73 +148,80 @@ public void pollQueryNameAdapter() throws Exception {
151148
assertThat(queryExp.apply(new ObjectName("java.lang:type=Runtime"))).isTrue();
152149

153150
Message<?> result = channel3.receive(testTimeout);
154-
assertThat(result).isNotNull();
155-
156-
assertThat(result.getPayload().getClass()).isEqualTo(HashMap.class);
151+
assertThat(result)
152+
.isNotNull()
153+
.extracting(Message::getPayload)
154+
.isInstanceOf(HashMap.class);
157155

158156
@SuppressWarnings("unchecked")
159157
Map<String, Object> beans = (Map<String, Object>) result.getPayload();
160158

161159
// test for a couple of MBeans
162-
assertThat(beans.containsKey("java.lang:type=OperatingSystem")).isFalse();
163-
assertThat(beans.containsKey("java.lang:type=Runtime")).isTrue();
160+
assertThat(beans)
161+
.containsKey("java.lang:type=Runtime")
162+
.doesNotContainKey("java.lang:type=OperatingSystem");
164163

165164
adapterQueryName.stop();
166165
}
167166

168167
@Test
169-
public void pollQueryNameBeanAdapter() throws Exception {
168+
public void pollQueryNameBeanAdapter() {
170169
adapterQueryNameBean.start();
171170

172171
Message<?> result = channel4.receive(testTimeout);
173-
assertThat(result).isNotNull();
174-
175-
assertThat(result.getPayload().getClass()).isEqualTo(HashMap.class);
172+
assertThat(result)
173+
.isNotNull()
174+
.extracting(Message::getPayload)
175+
.isInstanceOf(HashMap.class);
176176

177177
@SuppressWarnings("unchecked")
178178
Map<String, Object> beans = (Map<String, Object>) result.getPayload();
179179

180180
// test for a couple of MBeans
181-
assertThat(beans.containsKey("java.lang:type=OperatingSystem")).isTrue();
182-
assertThat(beans.containsKey("java.lang:type=Runtime")).isFalse();
181+
assertThat(beans)
182+
.containsKey("java.lang:type=OperatingSystem")
183+
.doesNotContainKey("java.lang:type=Runtime");
183184

184185
adapterQueryNameBean.stop();
185186
}
186187

187188
@Test
188-
public void pollQueryExprBeanAdapter() throws Exception {
189+
public void pollQueryExprBeanAdapter() {
189190
adapterQueryExprBean.start();
190191

191192
Message<?> result = channel5.receive(testTimeout);
192-
assertThat(result).isNotNull();
193-
194-
assertThat(result.getPayload().getClass()).isEqualTo(HashMap.class);
193+
assertThat(result)
194+
.isNotNull()
195+
.extracting(Message::getPayload)
196+
.isInstanceOf(HashMap.class);
195197

196198
@SuppressWarnings("unchecked")
197199
Map<String, Object> beans = (Map<String, Object>) result.getPayload();
198200

199201
// test for a couple of MBeans
200-
assertThat(beans.containsKey("java.lang:type=OperatingSystem")).isFalse();
201-
assertThat(beans.containsKey("java.lang:type=Runtime")).isTrue();
202+
assertThat(beans)
203+
.containsKey("java.lang:type=Runtime")
204+
.doesNotContainKey("java.lang:type=OperatingSystem");
202205

203206
adapterQueryExprBean.stop();
204207
}
205208

206209
@Test
207-
public void pollConverterAdapter() throws Exception {
210+
public void pollConverterAdapter() {
208211
adapterConverter.start();
209212

210213
Message<?> result = channel6.receive(testTimeout);
211-
assertThat(result).isNotNull();
214+
assertThat(result)
215+
.isNotNull()
216+
.extracting(Message::getPayload)
217+
.isInstanceOf(HashMap.class);
212218

213-
assertThat(result.getPayload().getClass()).isEqualTo(HashMap.class);
214219

215220
@SuppressWarnings("unchecked")
216221
Map<String, Object> beans = (Map<String, Object>) result.getPayload();
217222

218223
// test for a couple of MBeans
219-
assertThat(beans.containsKey("java.lang:type=OperatingSystem")).isTrue();
220-
assertThat(beans.containsKey("java.lang:type=Runtime")).isTrue();
224+
assertThat(beans).containsKeys("java.lang:type=OperatingSystem", "java.lang:type=Runtime");
221225

222226
adapterConverter.stop();
223227
assertThat(TestUtils.getPropertyValue(adapterConverter, "source.converter")).isSameAs(converter);

0 commit comments

Comments
 (0)