Polish contribution

Closes gh-5455
This commit is contained in:
Stephane Nicoll 2016-03-21 11:02:22 +01:00
parent 2fc2ec457b
commit 96b7419916
5 changed files with 16 additions and 6 deletions

View File

@ -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 {
}

View File

@ -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;

View File

@ -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",

View File

@ -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,

View File

@ -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.