Skip to content

Commit

Permalink
Upgrade dependencies, including Gradle
Browse files Browse the repository at this point in the history
* Alongside with existing `springAmqpVersion` & `springVersion`
also expose `springDataVersion` & `springSecurityVersion`
project properties.
These can be used in external CI plans for compatibility builds
* Fix `IntegrationGraphServerTests` for the current state of graph -
The node name is now based on the endpoint id, not a `MH` bean name
* Fix MongoDB tests for compatibility with the latest driver
  • Loading branch information
artembilan committed Dec 27, 2019
1 parent fab7741 commit 9c68ae4
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 79 deletions.
26 changes: 13 additions & 13 deletions build.gradle
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.3.60'
ext.kotlinVersion = '1.3.61'
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
Expand Down Expand Up @@ -59,8 +59,8 @@ ext {
googleJsr305Version = '3.0.2'
groovyVersion = '2.5.8'
hamcrestVersion = '2.2'
hazelcastVersion = '3.12.4'
hibernateVersion = '5.4.9.Final'
hazelcastVersion = '3.12.5'
hibernateVersion = '5.4.10.Final'
hsqldbVersion = '2.5.0'
h2Version = '1.4.200'
jacksonVersion = '2.10.1'
Expand All @@ -77,26 +77,26 @@ ext {
jythonVersion = '2.7.0'
kryoShadedVersion = '4.0.2'
lettuceVersion = '5.2.1.RELEASE'
log4jVersion = '2.12.1'
log4jVersion = '2.13.0'
micrometerVersion = '1.3.2'
mockitoVersion = '3.2.0'
mockitoVersion = '3.2.4'
mongoDriverVersion = '4.0.0-SNAPSHOT'
mysqlVersion = '8.0.18'
pahoMqttClientVersion = '1.2.0'
postgresVersion = '42.2.8'
postgresVersion = '42.2.9'
reactorVersion = 'Dysprosium-SR1'
resilience4jVersion = '1.1.0'
resilience4jVersion = '1.2.0'
romeToolsVersion = '1.12.2'
rsocketVersion = '1.0.0-RC5'
servletApiVersion = '4.0.1'
smackVersion = '4.3.4'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.2.2.RELEASE'
springDataVersion = 'Neumann-BUILD-SNAPSHOT'
springSecurityVersion = '5.2.1.RELEASE'
springRetryVersion = '1.2.4.RELEASE'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.2.3.BUILD-SNAPSHOT'
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-BUILD-SNAPSHOT'
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.3.0.BUILD-SNAPSHOT'
springRetryVersion = '1.2.5.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.2.2.RELEASE'
springWsVersion = '3.0.8.RELEASE'
tomcatVersion = "9.0.29"
tomcatVersion = "9.0.30"
xstreamVersion = '1.4.11.1'
}

Expand Down Expand Up @@ -305,7 +305,7 @@ subprojects { subproject ->
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Expand Up @@ -217,7 +217,7 @@ void test() throws Exception {
assertThat(jsonArray).hasSize(1);

jsonArray = JsonPathUtils.evaluate(baos.toByteArray(),
"$..nodes[?(@.name == 'services.foo.serviceActivator.handler')]");
"$..nodes[?(@.name == 'services.foo.serviceActivator')]");

assertThat(jsonArray).hasSize(1);

Expand Down
Expand Up @@ -19,6 +19,7 @@
import java.time.Duration;

import org.bson.Document;
import org.bson.UuidRepresentation;
import org.bson.conversions.Bson;
import org.junit.Rule;

Expand All @@ -38,6 +39,7 @@
import org.springframework.integration.mongodb.outbound.MessageCollectionCallback;
import org.springframework.messaging.Message;

import com.mongodb.MongoClientSettings;
import com.mongodb.MongoException;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoCollection;
Expand All @@ -58,11 +60,15 @@ public abstract class MongoDbAvailableTests {
@Rule
public MongoDbAvailableRule mongoDbAvailableRule = new MongoDbAvailableRule();

public static final MongoDatabaseFactory MONGO_DATABASE_FACTORY =
new SimpleMongoClientDatabaseFactory(
MongoClients.create(
MongoClientSettings.builder().uuidRepresentation(UuidRepresentation.STANDARD).build()),
"test");

protected MongoDatabaseFactory prepareMongoFactory(String... additionalCollectionsToDrop) {
MongoDatabaseFactory mongoDbFactory = new SimpleMongoClientDatabaseFactory(MongoClients.create(), "test");
cleanupCollections(mongoDbFactory, additionalCollectionsToDrop);
return mongoDbFactory;
cleanupCollections(MONGO_DATABASE_FACTORY, additionalCollectionsToDrop);
return MONGO_DATABASE_FACTORY;
}

protected ReactiveMongoDatabaseFactory prepareReactiveMongoFactory(String... additionalCollectionsToDrop) {
Expand Down
Expand Up @@ -31,7 +31,6 @@

import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.history.MessageHistory;
Expand All @@ -47,8 +46,6 @@
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.GenericMessage;

import com.mongodb.client.MongoClients;

/**
* @author Oleg Zhurakousky
* @author Gary Russell
Expand All @@ -59,9 +56,6 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail

protected final GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();

protected final SimpleMongoClientDatabaseFactory clientDbFactory =
new SimpleMongoClientDatabaseFactory(MongoClients.create(), "test");

@Before
public void setup() {
this.testApplicationContext.refresh();
Expand All @@ -70,7 +64,7 @@ public void setup() {
@After
public void tearDown() {
this.testApplicationContext.close();
cleanupCollections(this.clientDbFactory);
cleanupCollections(MONGO_DATABASE_FACTORY);
}

@Test
Expand Down
Expand Up @@ -28,7 +28,6 @@

import org.springframework.context.support.GenericApplicationContext;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.history.MessageHistory;
import org.springframework.integration.message.AdviceMessage;
Expand All @@ -44,8 +43,6 @@
import org.springframework.messaging.support.ErrorMessage;
import org.springframework.messaging.support.GenericMessage;

import com.mongodb.client.MongoClients;

/**
*
* @author Mark Fisher
Expand All @@ -58,9 +55,6 @@ public abstract class AbstractMongoDbMessageStoreTests extends MongoDbAvailableT

protected final GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();

protected final SimpleMongoClientDatabaseFactory clientDbFactory =
new SimpleMongoClientDatabaseFactory(MongoClients.create(), "test");

@Before
public void setup() {
this.testApplicationContext.refresh();
Expand All @@ -69,7 +63,7 @@ public void setup() {
@After
public void tearDown() {
this.testApplicationContext.close();
cleanupCollections(this.clientDbFactory);
cleanupCollections(MONGO_DATABASE_FACTORY);
}

@Test
Expand Down
Expand Up @@ -47,7 +47,8 @@ public class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMe

@Override
protected ConfigurableMongoDbMessageStore getMessageGroupStore() {
ConfigurableMongoDbMessageStore mongoDbMessageStore = new ConfigurableMongoDbMessageStore(this.clientDbFactory);
ConfigurableMongoDbMessageStore mongoDbMessageStore =
new ConfigurableMongoDbMessageStore(MONGO_DATABASE_FACTORY);
mongoDbMessageStore.setApplicationContext(this.testApplicationContext);
mongoDbMessageStore.afterPropertiesSet();
return mongoDbMessageStore;
Expand Down
Expand Up @@ -3,14 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
https://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/data/mongo
https://www.springframework.org/schema/data/mongo/spring-mongo.xsd">

<mongo:db-factory dbname="test"/>
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/data/mongo https://www.springframework.org/schema/data/mongo/spring-mongo.xsd
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">

<util:constant id="mongoDbFactory"
static-field="org.springframework.integration.mongodb.store.ConfigurableMongoDbMessageGroupStoreTests.MONGO_DATABASE_FACTORY"/>

<mongo:auditing/>

Expand Down
Expand Up @@ -27,7 +27,8 @@ public class ConfigurableMongoDbMessageStoreTests extends AbstractMongoDbMessage

@Override
protected MessageStore getMessageStore() {
ConfigurableMongoDbMessageStore mongoDbMessageStore = new ConfigurableMongoDbMessageStore(this.clientDbFactory);
ConfigurableMongoDbMessageStore mongoDbMessageStore =
new ConfigurableMongoDbMessageStore(MONGO_DATABASE_FACTORY);
mongoDbMessageStore.setApplicationContext(this.testApplicationContext);
mongoDbMessageStore.afterPropertiesSet();
return mongoDbMessageStore;
Expand Down
Expand Up @@ -32,7 +32,7 @@ public class MongoDbMessageGroupStoreTests extends AbstractMongoDbMessageGroupSt
@Override
protected MongoDbMessageStore getMessageGroupStore() {
MongoDbMessageStore mongoDbMessageStore =
new MongoDbMessageStore(this.clientDbFactory);
new MongoDbMessageStore(MONGO_DATABASE_FACTORY);
mongoDbMessageStore.afterPropertiesSet();
return mongoDbMessageStore;
}
Expand Down
Expand Up @@ -25,7 +25,6 @@
import org.junit.Test;

import org.springframework.context.support.GenericApplicationContext;
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
import org.springframework.integration.mongodb.rules.MongoDbAvailable;
import org.springframework.integration.mongodb.rules.MongoDbAvailableTests;
import org.springframework.integration.support.MessageBuilder;
Expand All @@ -34,8 +33,6 @@
import org.springframework.integration.transformer.ClaimCheckOutTransformer;
import org.springframework.messaging.Message;

import com.mongodb.client.MongoClients;

/**
* @author Mark Fisher
* @author Artem Bilan
Expand All @@ -44,9 +41,6 @@ public class MongoDbMessageStoreClaimCheckIntegrationTests extends MongoDbAvaila

private final GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();

private final SimpleMongoClientDatabaseFactory clientDbFactory =
new SimpleMongoClientDatabaseFactory(MongoClients.create(), "test");

@Before
public void setup() {
this.testApplicationContext.refresh();
Expand All @@ -60,7 +54,7 @@ public void tearDown() {
@Test
@MongoDbAvailable
public void stringPayload() {
MongoDbMessageStore messageStore = new MongoDbMessageStore(this.clientDbFactory);
MongoDbMessageStore messageStore = new MongoDbMessageStore(MONGO_DATABASE_FACTORY);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
ClaimCheckOutTransformer checkout = new ClaimCheckOutTransformer(messageStore);
Expand All @@ -76,7 +70,7 @@ public void stringPayload() {
@Test
@MongoDbAvailable
public void objectPayload() {
MongoDbMessageStore messageStore = new MongoDbMessageStore(this.clientDbFactory);
MongoDbMessageStore messageStore = new MongoDbMessageStore(MONGO_DATABASE_FACTORY);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
ClaimCheckOutTransformer checkout = new ClaimCheckOutTransformer(messageStore);
Expand All @@ -96,7 +90,7 @@ public void objectPayload() {
@Test
@MongoDbAvailable
public void stringPayloadConfigurable() {
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(this.clientDbFactory);
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(MONGO_DATABASE_FACTORY);
messageStore.setApplicationContext(this.testApplicationContext);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
Expand All @@ -113,7 +107,7 @@ public void stringPayloadConfigurable() {
@Test
@MongoDbAvailable
public void objectPayloadConfigurable() {
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(this.clientDbFactory);
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(MONGO_DATABASE_FACTORY);
messageStore.setApplicationContext(this.testApplicationContext);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
Expand Down
Expand Up @@ -39,15 +39,15 @@ public class MongoDbMessageStoreTests extends AbstractMongoDbMessageStoreTests {

@Override
protected MessageStore getMessageStore() {
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore(this.clientDbFactory);
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore(MONGO_DATABASE_FACTORY);
mongoDbMessageStore.afterPropertiesSet();
return mongoDbMessageStore;
}

@Test
@MongoDbAvailable
public void testCustomConverter() throws InterruptedException {
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore(this.clientDbFactory);
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore(MONGO_DATABASE_FACTORY);
FooToBytesConverter fooToBytesConverter = new FooToBytesConverter();
mongoDbMessageStore.setCustomConverters(fooToBytesConverter);
mongoDbMessageStore.afterPropertiesSet();
Expand Down
Expand Up @@ -17,18 +17,7 @@
</int:channel>

<bean id="mongoStore" class="org.springframework.integration.mongodb.store.MongoDbMessageStore">
<constructor-arg ref="mongoConnectionFactory"/>
</bean>

<bean id="mongoConnectionFactory" class="org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory">
<constructor-arg>
<bean class="org.springframework.data.mongodb.core.MongoClientFactoryBean">
<property name="mongoClientSettings">
<bean class="org.springframework.data.mongodb.core.MongoClientSettingsFactoryBean"/>
</property>
</bean>
</constructor-arg>
<constructor-arg value="test"/>
<constructor-arg value="#{T (org.springframework.integration.mongodb.store.MongoDbMessageGroupStoreTests).MONGO_DATABASE_FACTORY}"/>
</bean>

</beans>
Expand Up @@ -17,18 +17,8 @@
</int:channel>

<bean id="mongoStore" class="org.springframework.integration.mongodb.store.ConfigurableMongoDbMessageStore">
<constructor-arg ref="mongoConnectionFactory"/>
</bean>

<bean id="mongoConnectionFactory" class="org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory">
<constructor-arg>
<bean class="org.springframework.data.mongodb.core.MongoClientFactoryBean">
<property name="mongoClientSettings">
<bean class="org.springframework.data.mongodb.core.MongoClientSettingsFactoryBean"/>
</property>
</bean>
</constructor-arg>
<constructor-arg value="test"/>
<constructor-arg
value="#{T (org.springframework.integration.mongodb.store.ConfigurableMongoDbMessageGroupStoreTests).MONGO_DATABASE_FACTORY}"/>
</bean>

</beans>

0 comments on commit 9c68ae4

Please sign in to comment.