Commit 96b74199 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish contribution

Closes gh-5455
parent 2fc2ec45
......@@ -18,6 +18,7 @@ package org.springframework.boot.autoconfigure.data.redis;
import redis.clients.jedis.Jedis;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
......@@ -40,5 +41,6 @@ import org.springframework.data.redis.repository.support.RedisRepositoryFactoryB
@ConditionalOnProperty(prefix = "spring.data.redis.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnMissingBean(RedisRepositoryFactoryBean.class)
@Import(RedisRepositoriesAutoConfigureRegistrar.class)
@AutoConfigureAfter(RedisAutoConfiguration.class)
public class RedisRepositoriesAutoConfiguration {
}
......@@ -30,8 +30,9 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
* @author Eddú Meléndez
* @since 1.4.0
*/
public class RedisRepositoriesAutoConfigureRegistrar extends
AbstractRepositoryConfigurationSourceSupport {
class RedisRepositoriesAutoConfigureRegistrar
extends AbstractRepositoryConfigurationSourceSupport {
@Override
protected Class<? extends Annotation> getAnnotation() {
return EnableRedisRepositories.class;
......
......@@ -90,6 +90,12 @@
"description": "Enable Mongo repositories.",
"defaultValue": true
},
{
"name": "spring.data.redis.repositories.enabled",
"type": "java.lang.Boolean",
"description": "Enable Redis repositories.",
"defaultValue": true
},
{
"name": "spring.data.solr.repositories.enabled",
"type": "java.lang.Boolean",
......
......@@ -43,7 +43,8 @@ public class RedisRepositoriesAutoConfigurationTests {
@Rule
public RedisTestServer redis = new RedisTestServer();
private AnnotationConfigApplicationContext context;
private AnnotationConfigApplicationContext context
= new AnnotationConfigApplicationContext();
@After
public void close() {
......@@ -52,7 +53,6 @@ public class RedisRepositoriesAutoConfigurationTests {
@Test
public void testDefaultRepositoryConfiguration() {
this.context = new AnnotationConfigApplicationContext();
this.context.register(TestConfiguration.class,
RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
......@@ -62,7 +62,6 @@ public class RedisRepositoriesAutoConfigurationTests {
@Test
public void testNoRepositoryConfiguration() {
this.context = new AnnotationConfigApplicationContext();
this.context.register(EmptyConfiguration.class,
RedisAutoConfiguration.class,
RedisRepositoriesAutoConfiguration.class,
......@@ -73,7 +72,6 @@ public class RedisRepositoriesAutoConfigurationTests {
@Test
public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() {
this.context = new AnnotationConfigApplicationContext();
this.context.register(CustomizedConfiguration.class,
RedisAutoConfiguration.class,
RedisRepositoriesAutoConfiguration.class,
......
......@@ -533,6 +533,9 @@ content into your application; rather pick only the properties that you need.
spring.data.mongodb.uri=mongodb://localhost/test # Mongo database URI. When set, host and port are ignored.
spring.data.mongodb.username= # Login user of the mongo server.
# DATA REDIS
spring.data.redis.repositories.enabled=true # Enable Redis repositories.
# DATA REST ({sc-spring-boot-autoconfigure}/data/rest/RepositoryRestProperties.{sc-ext}[RepositoryRestProperties])
spring.data.rest.base-path= # Base path to be used by Spring Data REST to expose repository resources.
spring.data.rest.default-page-size= # Default size of pages.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment