mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Upgrade to the Spring Data Dijkstra release train
In addition to the upgrade to Dijkstra (#743) Spring HATEOAS has been upgraded to 0.11.0 (#801) and Mongo's Java driver has been upgraded to 2.12.1 (#689). In both cases this is the same version as is used by Dijkstra RC1. The new version of Mongo's Java driver changes the exception that's thrown when Mongo isn't running and a connection attempt fails. The Mongo sample has been updated accordingly. RepositoryRestMvcAutoConfiguration has been updated to be configured before JpaRepositoriesAutoConfiguration. This ensures that the former's transitive import of SpringDataJacksonConfiguration takes precedence over the latter's import of the same. This is necessary as RepositoryRestMvcConfiguration requires a bean that's declared by SpringDataJacksonConfiguration and, if JpaRepositoriesAutoConfiguration is processed first, its conditions may cause the import SpringDataJacksonConfiguration to be skipped causing instantiation of RepositoryRestMvcConfiguration to fail. Closes #689 Closes #743
This commit is contained in:
parent
638561d8f8
commit
62ac51eead
@ -16,10 +16,12 @@
|
||||
|
||||
package org.springframework.boot.autoconfigure.data.rest;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.autoconfigure.data.JpaRepositoriesAutoConfiguration;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
|
||||
@ -35,7 +37,7 @@ import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguratio
|
||||
* Once in effect, the auto-configuration is the equivalent of importing the
|
||||
* {@link RepositoryRestMvcConfiguration}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Rob Winch
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@ -44,6 +46,7 @@ import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguratio
|
||||
@ConditionalOnMissingBean(RepositoryRestMvcConfiguration.class)
|
||||
@ConditionalOnClass(RepositoryRestMvcConfiguration.class)
|
||||
@Import(RepositoryRestMvcConfiguration.class)
|
||||
@AutoConfigureBefore(JpaRepositoriesAutoConfiguration.class)
|
||||
public class RepositoryRestMvcAutoConfiguration {
|
||||
|
||||
}
|
||||
|
@ -96,10 +96,10 @@ public class RedisAutoConfiguration {
|
||||
private JedisPoolConfig jedisPoolConfig() {
|
||||
JedisPoolConfig config = new JedisPoolConfig();
|
||||
RedisProperties.Pool props = this.properties.getPool();
|
||||
config.setMaxActive(props.getMaxActive());
|
||||
config.setMaxTotal(props.getMaxActive());
|
||||
config.setMaxIdle(props.getMaxIdle());
|
||||
config.setMinIdle(props.getMinIdle());
|
||||
config.setMaxWait(props.getMaxWait());
|
||||
config.setMaxWaitMillis(props.getMaxWait());
|
||||
return config;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
||||
<hsqldb.version>2.3.2</hsqldb.version>
|
||||
<jackson.version>2.3.3</jackson.version>
|
||||
<javassist.version>3.18.1-GA</javassist.version> <!-- Same as Hibernate -->
|
||||
<jedis.version>2.1.0</jedis.version>
|
||||
<jedis.version>2.4.1</jedis.version>
|
||||
<jetty.version>8.1.14.v20131031</jetty.version>
|
||||
<joda-time.version>2.3</joda-time.version>
|
||||
<jolokia.version>1.2.0</jolokia.version>
|
||||
@ -79,7 +79,7 @@
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<logback.version>1.1.2</logback.version>
|
||||
<mockito.version>1.9.5</mockito.version>
|
||||
<mongodb.version>2.11.4</mongodb.version>
|
||||
<mongodb.version>2.12.1</mongodb.version>
|
||||
<mysql.version>5.1.30</mysql.version>
|
||||
<neo4j.version>2.0.2</neo4j.version>
|
||||
<reactor.version>1.1.1.BUILD-SNAPSHOT</reactor.version>
|
||||
@ -89,10 +89,8 @@
|
||||
<spock.version>0.7-groovy-2.0</spock.version>
|
||||
<spring.version>4.0.4.RELEASE</spring.version>
|
||||
<spring-batch.version>2.2.6.RELEASE</spring-batch.version>
|
||||
<spring-data-gemfire.version>1.3.3.RELEASE</spring-data-gemfire.version>
|
||||
<spring-data-redis.version>1.1.1.RELEASE</spring-data-redis.version>
|
||||
<spring-data-releasetrain.version>Codd-SR2</spring-data-releasetrain.version>
|
||||
<spring-hateoas.version>0.9.0.RELEASE</spring-hateoas.version>
|
||||
<spring-data-releasetrain.version>Dijkstra-RC1</spring-data-releasetrain.version>
|
||||
<spring-hateoas.version>0.11.0.RELEASE</spring-hateoas.version>
|
||||
<spring-integration.version>4.0.0.RELEASE</spring-integration.version>
|
||||
<spring-plugin.version>1.0.0.RELEASE</spring-plugin.version>
|
||||
<spring-amqp.version>1.3.2.RELEASE</spring-amqp.version>
|
||||
@ -885,16 +883,6 @@
|
||||
<artifactId>spring-batch-core</artifactId>
|
||||
<version>${spring-batch.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-gemfire</artifactId>
|
||||
<version>${spring-data-gemfire.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-redis</artifactId>
|
||||
<version>${spring-data-redis.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-releasetrain</artifactId>
|
||||
|
@ -16,18 +16,18 @@
|
||||
|
||||
package sample.data.mongo;
|
||||
|
||||
import java.net.ConnectException;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.test.OutputCapture;
|
||||
import org.springframework.core.NestedCheckedException;
|
||||
|
||||
import com.mongodb.MongoServerSelectionException;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Tests for {@link SampleMongoApplication}.
|
||||
*
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class SampleMongoApplicationTests {
|
||||
@ -54,9 +54,9 @@ public class SampleMongoApplicationTests {
|
||||
@SuppressWarnings("serial")
|
||||
NestedCheckedException nested = new NestedCheckedException("failed", ex) {
|
||||
};
|
||||
if (nested.contains(ConnectException.class)) {
|
||||
Throwable root = nested.getRootCause();
|
||||
if (root.getMessage().contains("Connection refused")) {
|
||||
Throwable root = nested.getRootCause();
|
||||
if (root instanceof MongoServerSelectionException) {
|
||||
if (root.getMessage().contains("Unable to connect to any server")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user