Skip to content

Commit 8d08e81

Browse files
committed
Fix tests that fail when Redis is unavailable
1 parent 7942d9f commit 8d08e81

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

spring-boot-samples/spring-boot-sample-data-redis/src/test/java/sample/data/redis/SampleRedisApplicationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void testDefaultSettings() throws Exception {
3939
try {
4040
SampleRedisApplication.main(new String[0]);
4141
}
42-
catch (IllegalStateException ex) {
42+
catch (Exception ex) {
4343
if (!redisServerRunning(ex)) {
4444
return;
4545
}

spring-boot-samples/spring-boot-sample-metrics-redis/src/main/resources/application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ spring.metrics.export.redis.key: keys.metrics.sample
44
spring.metrics.export.aggregate.prefix: ${random.value:0000}.${spring.application.name:application}
55
spring.metrics.export.aggregate.key-pattern: d
66
spring.jmx.default-domain: org.springframework.boot
7+
spring.data.redis.repositories.enabled=false

0 commit comments

Comments
 (0)