From 8d08e816a79a7390dc6ba086d5709f1049b5807f Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 21 Mar 2016 22:52:45 -0700 Subject: [PATCH] Fix tests that fail when Redis is unavailable --- .../java/sample/data/redis/SampleRedisApplicationTests.java | 2 +- .../src/main/resources/application.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-samples/spring-boot-sample-data-redis/src/test/java/sample/data/redis/SampleRedisApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-redis/src/test/java/sample/data/redis/SampleRedisApplicationTests.java index 63a14e3e6b..3152bdc8dd 100644 --- a/spring-boot-samples/spring-boot-sample-data-redis/src/test/java/sample/data/redis/SampleRedisApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-redis/src/test/java/sample/data/redis/SampleRedisApplicationTests.java @@ -39,7 +39,7 @@ public class SampleRedisApplicationTests { try { SampleRedisApplication.main(new String[0]); } - catch (IllegalStateException ex) { + catch (Exception ex) { if (!redisServerRunning(ex)) { return; } diff --git a/spring-boot-samples/spring-boot-sample-metrics-redis/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-metrics-redis/src/main/resources/application.properties index 26fa18e930..78f2c31ab4 100644 --- a/spring-boot-samples/spring-boot-sample-metrics-redis/src/main/resources/application.properties +++ b/spring-boot-samples/spring-boot-sample-metrics-redis/src/main/resources/application.properties @@ -4,3 +4,4 @@ spring.metrics.export.redis.key: keys.metrics.sample spring.metrics.export.aggregate.prefix: ${random.value:0000}.${spring.application.name:application} spring.metrics.export.aggregate.key-pattern: d spring.jmx.default-domain: org.springframework.boot +spring.data.redis.repositories.enabled=false \ No newline at end of file