Skip to content

Commit e5740f2

Browse files
committed
Upgrade dependencies
* Gradle 6.1.1 * MongoDb 4.0 * Other Spring dependencies to `BUILD-SNAPSHOT` * Fix MongoDb tests according latest Spring Data * State in the docs that both MongoDb driver are `optional` now in the dependencies
1 parent d792915 commit e5740f2

25 files changed

+151
-150
lines changed

build.gradle

+11-10
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ ext {
4747
apacheSshdVersion = '2.3.0'
4848
avroVersion = '1.9.1'
4949
aspectjVersion = '1.9.5'
50-
assertjVersion = '3.14.0'
51-
assertkVersion = '0.20'
50+
assertjVersion = '3.15.0'
51+
assertkVersion = '0.21'
5252
awaitilityVersion = '4.0.2'
5353
commonsDbcp2Version = '2.7.0'
5454
commonsIoVersion = '2.6'
@@ -59,11 +59,11 @@ ext {
5959
googleJsr305Version = '3.0.2'
6060
groovyVersion = '2.5.9'
6161
hamcrestVersion = '2.2'
62-
hazelcastVersion = '3.12.5'
62+
hazelcastVersion = '3.12.6'
6363
hibernateVersion = '5.4.10.Final'
6464
hsqldbVersion = '2.5.0'
6565
h2Version = '1.4.200'
66-
jacksonVersion = '2.10.1'
66+
jacksonVersion = '2.10.2'
6767
javaxActivationVersion = '1.2.0'
6868
javaxMailVersion = '1.6.2'
6969
jmsApiVersion = '2.0.1'
@@ -73,15 +73,15 @@ ext {
7373
jschVersion = '0.1.55'
7474
jsonpathVersion = '2.4.0'
7575
junit4Version = '4.13'
76-
junitJupiterVersion = '5.5.2'
76+
junitJupiterVersion = '5.6.0'
7777
jythonVersion = '2.7.0'
7878
kryoShadedVersion = '4.0.2'
7979
lettuceVersion = '5.2.1.RELEASE'
8080
log4jVersion = '2.13.0'
8181
micrometerVersion = '1.3.3'
8282
mockitoVersion = '3.2.4'
83-
mongoDriverVersion = '1.13.0'
84-
mysqlVersion = '8.0.18'
83+
mongoDriverVersion = '4.0.0-beta1'
84+
mysqlVersion = '8.0.19'
8585
pahoMqttClientVersion = '1.2.0'
8686
postgresVersion = '42.2.9'
8787
reactorVersion = 'Dysprosium-SR4'
@@ -91,8 +91,8 @@ ext {
9191
servletApiVersion = '4.0.1'
9292
smackVersion = '4.3.4'
9393
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.2.3.RELEASE'
94-
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-M2'
95-
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.3.0.M1'
94+
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-BUILD-SNAPSHOT'
95+
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.3.0.BUILD-SNAPSHOT'
9696
springRetryVersion = '1.2.5.RELEASE'
9797
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.2.3.RELEASE'
9898
springWsVersion = '3.0.8.RELEASE'
@@ -313,7 +313,7 @@ configure(javaProjects) { subproject ->
313313

314314
checkstyle {
315315
configFile = file("$rootDir/src/checkstyle/checkstyle.xml")
316-
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '8.28'
316+
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '8.29'
317317
}
318318

319319
jar {
@@ -592,6 +592,7 @@ project('spring-integration-mongodb') {
592592
api ('org.springframework.data:spring-data-mongodb') {
593593
exclude group: 'org.springframework'
594594
}
595+
optionalApi "org.mongodb:mongodb-driver-sync:$mongoDriverVersion"
595596
optionalApi "org.mongodb:mongodb-driver-reactivestreams:$mongoDriverVersion"
596597
}
597598
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

spring-integration-core/src/test/java/org/springframework/integration/channel/reactive/ReactiveStreamsConsumerTests.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static org.assertj.core.api.Assertions.assertThat;
2020
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
21+
import static org.awaitility.Awaitility.await;
2122
import static org.mockito.ArgumentMatchers.any;
2223
import static org.mockito.BDDMockito.willAnswer;
2324
import static org.mockito.Mockito.mock;
@@ -181,7 +182,9 @@ public void testReactiveStreamsConsumerPollableChannel() throws InterruptedExcep
181182
BlockingQueue<Message<?>> messages = new LinkedBlockingQueue<>();
182183

183184
willAnswer(i -> {
184-
messages.put(i.getArgument(0));
185+
Message<?> message = i.getArgument(0);
186+
LOGGER.debug("Polled message: " + message);
187+
messages.put(message);
185188
return null;
186189
})
187190
.given(testSubscriber)
@@ -220,6 +223,8 @@ public void testReactiveStreamsConsumerPollableChannel() throws InterruptedExcep
220223

221224
testChannel.send(testMessage2);
222225

226+
await().untilAsserted(() -> assertThat(messages).hasSizeGreaterThan(0));
227+
223228
LOGGER.debug("Messages to poll: " + messages);
224229

225230
message = messages.poll(10, TimeUnit.SECONDS);

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/dsl/MongoDb.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.integration.mongodb.dsl;
1818

19-
import org.springframework.data.mongodb.MongoDbFactory;
19+
import org.springframework.data.mongodb.MongoDatabaseFactory;
2020
import org.springframework.data.mongodb.ReactiveMongoDatabaseFactory;
2121
import org.springframework.data.mongodb.core.MongoOperations;
2222
import org.springframework.data.mongodb.core.ReactiveMongoOperations;
@@ -37,13 +37,13 @@ public final class MongoDb {
3737

3838
/**
3939
* Create a {@link MongoDbOutboundGatewaySpec} builder instance
40-
* based on the provided {@link MongoDbFactory} and {@link MongoConverter}.
41-
* @param mongoDbFactory the {@link MongoDbFactory} to use.
40+
* based on the provided {@link MongoDatabaseFactory} and {@link MongoConverter}.
41+
* @param mongoDbFactory the {@link MongoDatabaseFactory} to use.
4242
* @param mongoConverter the {@link MongoConverter} to use.
4343
* @return the {@link MongoDbOutboundGatewaySpec} instance
4444
*/
4545
public static MongoDbOutboundGatewaySpec outboundGateway(
46-
MongoDbFactory mongoDbFactory, MongoConverter mongoConverter) {
46+
MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter) {
4747

4848
return new MongoDbOutboundGatewaySpec(mongoDbFactory, mongoConverter);
4949
}

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/dsl/MongoDbOutboundGatewaySpec.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import java.util.function.Function;
2020

21-
import org.springframework.data.mongodb.MongoDbFactory;
21+
import org.springframework.data.mongodb.MongoDatabaseFactory;
2222
import org.springframework.data.mongodb.core.MongoOperations;
2323
import org.springframework.data.mongodb.core.convert.MongoConverter;
2424
import org.springframework.data.mongodb.core.query.Query;
@@ -40,7 +40,7 @@
4040
public class MongoDbOutboundGatewaySpec
4141
extends MessageHandlerSpec<MongoDbOutboundGatewaySpec, MongoDbOutboundGateway> {
4242

43-
MongoDbOutboundGatewaySpec(MongoDbFactory mongoDbFactory, MongoConverter mongoConverter) {
43+
MongoDbOutboundGatewaySpec(MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter) {
4444
this.target = new MongoDbOutboundGateway(mongoDbFactory, mongoConverter);
4545
this.target.setRequiresReply(true);
4646
}

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/inbound/MongoDbMessageSource.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import java.util.List;
2020

21-
import org.springframework.data.mongodb.MongoDbFactory;
21+
import org.springframework.data.mongodb.MongoDatabaseFactory;
2222
import org.springframework.data.mongodb.core.MongoOperations;
2323
import org.springframework.data.mongodb.core.MongoTemplate;
2424
import org.springframework.data.mongodb.core.convert.MongoConverter;
@@ -67,7 +67,7 @@
6767
public class MongoDbMessageSource extends AbstractMessageSource<Object> {
6868

6969
@Nullable
70-
private final MongoDbFactory mongoDbFactory;
70+
private final MongoDatabaseFactory mongoDbFactory;
7171

7272
private final Expression queryExpression;
7373

@@ -86,13 +86,13 @@ public class MongoDbMessageSource extends AbstractMessageSource<Object> {
8686
private volatile boolean initialized = false;
8787

8888
/**
89-
* Creates an instance with the provided {@link MongoDbFactory} and SpEL expression
89+
* Creates an instance with the provided {@link MongoDatabaseFactory} and SpEL expression
9090
* which should resolve to a MongoDb 'query' string (see https://www.mongodb.org/display/DOCS/Querying).
9191
* The 'queryExpression' will be evaluated on every call to the {@link #receive()} method.
9292
* @param mongoDbFactory The mongodb factory.
9393
* @param queryExpression The query expression.
9494
*/
95-
public MongoDbMessageSource(MongoDbFactory mongoDbFactory, Expression queryExpression) {
95+
public MongoDbMessageSource(MongoDatabaseFactory mongoDbFactory, Expression queryExpression) {
9696
Assert.notNull(mongoDbFactory, "'mongoDbFactory' must not be null");
9797
Assert.notNull(queryExpression, "'queryExpression' must not be null");
9898
this.mongoDbFactory = mongoDbFactory;
@@ -154,7 +154,7 @@ public void setCollectionNameExpression(Expression collectionNameExpression) {
154154
/**
155155
* Allows you to provide a custom {@link MongoConverter} used to assist in deserialization
156156
* data read from MongoDb. Only allowed if this instance was constructed with a
157-
* {@link MongoDbFactory}.
157+
* {@link MongoDatabaseFactory}.
158158
* @param mongoConverter The mongo converter.
159159
*/
160160
public void setMongoConverter(MongoConverter mongoConverter) {

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/metadata/MongoDbMetadataStore.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import org.bson.Document;
2323

24-
import org.springframework.data.mongodb.MongoDbFactory;
24+
import org.springframework.data.mongodb.MongoDatabaseFactory;
2525
import org.springframework.data.mongodb.core.FindAndModifyOptions;
2626
import org.springframework.data.mongodb.core.MongoTemplate;
2727
import org.springframework.data.mongodb.core.query.Criteria;
@@ -58,21 +58,21 @@ public class MongoDbMetadataStore implements ConcurrentMetadataStore {
5858
private final String collectionName;
5959

6060
/**
61-
* Configure the MongoDbMetadataStore by provided {@link MongoDbFactory} and
61+
* Configure the MongoDbMetadataStore by provided {@link MongoDatabaseFactory} and
6262
* default collection name - {@link #DEFAULT_COLLECTION_NAME}.
6363
* @param factory the mongodb factory
6464
*/
65-
public MongoDbMetadataStore(MongoDbFactory factory) {
65+
public MongoDbMetadataStore(MongoDatabaseFactory factory) {
6666
this(factory, DEFAULT_COLLECTION_NAME);
6767
}
6868

6969
/**
70-
* Configure the MongoDbMetadataStore by provided {@link MongoDbFactory} and
70+
* Configure the MongoDbMetadataStore by provided {@link MongoDatabaseFactory} and
7171
* collection name
7272
* @param factory the mongodb factory
7373
* @param collectionName the collection name where it persists the data
7474
*/
75-
public MongoDbMetadataStore(MongoDbFactory factory, String collectionName) {
75+
public MongoDbMetadataStore(MongoDatabaseFactory factory, String collectionName) {
7676
this(new MongoTemplate(factory), collectionName);
7777
}
7878

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbOutboundGateway.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.bson.Document;
2020

21-
import org.springframework.data.mongodb.MongoDbFactory;
21+
import org.springframework.data.mongodb.MongoDatabaseFactory;
2222
import org.springframework.data.mongodb.core.MongoOperations;
2323
import org.springframework.data.mongodb.core.MongoTemplate;
2424
import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
@@ -46,7 +46,7 @@
4646
*/
4747
public class MongoDbOutboundGateway extends AbstractReplyProducingMessageHandler {
4848

49-
private MongoDbFactory mongoDbFactory;
49+
private MongoDatabaseFactory mongoDbFactory;
5050

5151
private MongoConverter mongoConverter;
5252

@@ -64,12 +64,12 @@ public class MongoDbOutboundGateway extends AbstractReplyProducingMessageHandler
6464

6565
private Expression collectionNameExpression;
6666

67-
public MongoDbOutboundGateway(MongoDbFactory mongoDbFactory) {
67+
public MongoDbOutboundGateway(MongoDatabaseFactory mongoDbFactory) {
6868
this(mongoDbFactory, new MappingMongoConverter(new DefaultDbRefResolver(mongoDbFactory),
6969
new MongoMappingContext()));
7070
}
7171

72-
public MongoDbOutboundGateway(MongoDbFactory mongoDbFactory, MongoConverter mongoConverter) {
72+
public MongoDbOutboundGateway(MongoDatabaseFactory mongoDbFactory, MongoConverter mongoConverter) {
7373
Assert.notNull(mongoDbFactory, "mongoDatabaseFactory must not be null.");
7474
Assert.notNull(mongoConverter, "mongoConverter must not be null.");
7575
this.mongoDbFactory = mongoDbFactory;

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandler.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.integration.mongodb.outbound;
1818

19-
import org.springframework.data.mongodb.MongoDbFactory;
19+
import org.springframework.data.mongodb.MongoDatabaseFactory;
2020
import org.springframework.data.mongodb.core.MongoOperations;
2121
import org.springframework.data.mongodb.core.MongoTemplate;
2222
import org.springframework.data.mongodb.core.convert.MongoConverter;
@@ -42,7 +42,7 @@ public class MongoDbStoringMessageHandler extends AbstractMessageHandler {
4242

4343
private volatile MongoOperations mongoTemplate;
4444

45-
private volatile MongoDbFactory mongoDbFactory;
45+
private volatile MongoDatabaseFactory mongoDbFactory;
4646

4747
private volatile MongoConverter mongoConverter;
4848

@@ -53,11 +53,11 @@ public class MongoDbStoringMessageHandler extends AbstractMessageHandler {
5353
private volatile boolean initialized = false;
5454

5555
/**
56-
* Will construct this instance using provided {@link MongoDbFactory}
56+
* Will construct this instance using provided {@link MongoDatabaseFactory}
5757
*
5858
* @param mongoDbFactory The mongodb factory.
5959
*/
60-
public MongoDbStoringMessageHandler(MongoDbFactory mongoDbFactory) {
60+
public MongoDbStoringMessageHandler(MongoDatabaseFactory mongoDbFactory) {
6161
Assert.notNull(mongoDbFactory, "'mongoDbFactory' must not be null");
6262

6363
this.mongoDbFactory = mongoDbFactory;
@@ -78,7 +78,7 @@ public MongoDbStoringMessageHandler(MongoOperations mongoTemplate) {
7878
/**
7979
* Allows you to provide custom {@link MongoConverter} used to assist in serialization
8080
* of data written to MongoDb. Only allowed if this instance was constructed with a
81-
* {@link MongoDbFactory}.
81+
* {@link MongoDatabaseFactory}.
8282
*
8383
* @param mongoConverter The mongo converter.
8484
*/

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.springframework.context.ApplicationContextAware;
3333
import org.springframework.dao.DuplicateKeyException;
3434
import org.springframework.data.domain.Sort;
35-
import org.springframework.data.mongodb.MongoDbFactory;
35+
import org.springframework.data.mongodb.MongoDatabaseFactory;
3636
import org.springframework.data.mongodb.core.FindAndModifyOptions;
3737
import org.springframework.data.mongodb.core.MongoTemplate;
3838
import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
@@ -76,7 +76,7 @@ public abstract class AbstractConfigurableMongoDbMessageStore extends AbstractMe
7676

7777
protected final String collectionName; // NOSONAR - final
7878

79-
protected final MongoDbFactory mongoDbFactory; // NOSONAR - final
79+
protected final MongoDatabaseFactory mongoDbFactory; // NOSONAR - final
8080

8181
private MongoTemplate mongoTemplate;
8282

@@ -94,11 +94,11 @@ public AbstractConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate, Stri
9494
this.mongoDbFactory = null;
9595
}
9696

97-
public AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, String collectionName) {
97+
public AbstractConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, String collectionName) {
9898
this(mongoDbFactory, null, collectionName);
9999
}
100100

101-
public AbstractConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory,
101+
public AbstractConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory,
102102
MappingMongoConverter mappingMongoConverter, String collectionName) {
103103
Assert.notNull(mongoDbFactory, "'mongoDbFactory' must not be null");
104104
Assert.hasText(collectionName, "'collectionName' must not be empty");

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.stream.StreamSupport;
2626

2727
import org.springframework.data.domain.Sort;
28-
import org.springframework.data.mongodb.MongoDbFactory;
28+
import org.springframework.data.mongodb.MongoDatabaseFactory;
2929
import org.springframework.data.mongodb.core.MongoTemplate;
3030
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
3131
import org.springframework.data.mongodb.core.query.Criteria;
@@ -68,19 +68,19 @@ public ConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate, String colle
6868
super(mongoTemplate, collectionName);
6969
}
7070

71-
public ConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory) {
71+
public ConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory) {
7272
this(mongoDbFactory, null, DEFAULT_COLLECTION_NAME);
7373
}
7474

75-
public ConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter) {
75+
public ConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter) {
7676
this(mongoDbFactory, mappingMongoConverter, DEFAULT_COLLECTION_NAME);
7777
}
7878

79-
public ConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, String collectionName) {
79+
public ConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, String collectionName) {
8080
this(mongoDbFactory, null, collectionName);
8181
}
8282

83-
public ConfigurableMongoDbMessageStore(MongoDbFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter,
83+
public ConfigurableMongoDbMessageStore(MongoDatabaseFactory mongoDbFactory, MappingMongoConverter mappingMongoConverter,
8484
String collectionName) {
8585

8686
super(mongoDbFactory, mappingMongoConverter, collectionName);

0 commit comments

Comments
 (0)