Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
259e6a6e
Commit
259e6a6e
authored
Nov 28, 2013
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RedisProperties prefix -> spring.redis
parent
e74da3fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
RedisAutoConfiguration.java
...work/boot/autoconfigure/redis/RedisAutoConfiguration.java
+1
-1
RedisAutoConfigurationTests.java
...boot/autoconfigure/redis/RedisAutoConfigurationTests.java
+14
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java
View file @
259e6a6e
...
@@ -82,7 +82,7 @@ public class RedisAutoConfiguration {
...
@@ -82,7 +82,7 @@ public class RedisAutoConfiguration {
}
}
@ConfigurationProperties
(
name
=
"spring.
data.
redis"
)
@ConfigurationProperties
(
name
=
"spring.redis"
)
public
static
class
RedisProperties
{
public
static
class
RedisProperties
{
private
String
host
=
"localhost"
;
private
String
host
=
"localhost"
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfigurationTests.java
View file @
259e6a6e
...
@@ -17,11 +17,14 @@
...
@@ -17,11 +17,14 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
redis
;
package
org
.
springframework
.
boot
.
autoconfigure
.
redis
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.TestUtils
;
import
org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory
;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
/**
/**
...
@@ -41,4 +44,15 @@ public class RedisAutoConfigurationTests {
...
@@ -41,4 +44,15 @@ public class RedisAutoConfigurationTests {
assertNotNull
(
this
.
context
.
getBean
(
StringRedisTemplate
.
class
));
assertNotNull
(
this
.
context
.
getBean
(
StringRedisTemplate
.
class
));
}
}
@Test
public
void
testOverrideRedisConfiguration
()
throws
Exception
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
TestUtils
.
addEnviroment
(
this
.
context
,
"spring.redis.host:foo"
);
this
.
context
.
register
(
RedisAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertEquals
(
"foo"
,
this
.
context
.
getBean
(
LettuceConnectionFactory
.
class
)
.
getHostName
());
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment