diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/EhCacheCacheConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/EhCacheCacheConfiguration.java index 48ae1a2f3b..06aeadac6b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/EhCacheCacheConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/EhCacheCacheConfiguration.java @@ -37,7 +37,7 @@ import org.springframework.core.io.Resource; * @since 1.3.0 */ @Configuration -@ConditionalOnClass({Cache.class, EhCacheCacheManager.class}) +@ConditionalOnClass({ Cache.class, EhCacheCacheManager.class }) @ConditionalOnMissingBean(CacheManager.class) @Conditional({ CacheCondition.class, EhCacheCacheConfiguration.ConfigAvailableCondition.class }) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java index 27f3a9d5b5..1eb631bc1a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Properties; + import javax.cache.CacheManager; import javax.cache.Caching; import javax.cache.configuration.MutableConfiguration; @@ -51,7 +52,7 @@ import org.springframework.util.StringUtils; * @since 1.3.0 */ @Configuration -@ConditionalOnClass({Caching.class, JCacheCacheManager.class}) +@ConditionalOnClass({ Caching.class, JCacheCacheManager.class }) @ConditionalOnMissingBean(org.springframework.cache.CacheManager.class) @Conditional({ CacheCondition.class, JCacheCacheConfiguration.JCacheAvailableCondition.class }) @@ -85,7 +86,8 @@ class JCacheCacheConfiguration { Resource configLocation = this.cacheProperties.resolveConfigLocation(); if (configLocation != null) { return cachingProvider.getCacheManager(configLocation.getURI(), - cachingProvider.getDefaultClassLoader(), createCacheManagerProperties(configLocation)); + cachingProvider.getDefaultClassLoader(), + createCacheManagerProperties(configLocation)); } return cachingProvider.getCacheManager(); } @@ -97,10 +99,12 @@ class JCacheCacheConfiguration { return Caching.getCachingProvider(); } - private Properties createCacheManagerProperties(Resource configLocation) throws IOException { + private Properties createCacheManagerProperties(Resource configLocation) + throws IOException { Properties properties = new Properties(); // Hazelcast does not use the URI as a mean to specify a custom config. - properties.setProperty("hazelcast.config.location", configLocation.getURI().toString()); + properties.setProperty("hazelcast.config.location", configLocation.getURI() + .toString()); return properties; } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index a011a63da4..e1a8c45361 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -269,9 +269,9 @@ public class CacheAutoConfigurationTests { public void jCacheCacheWithWrongConfig() { String cachingProviderFqn = MockCachingProvider.class.getName(); String configLocation = "org/springframework/boot/autoconfigure/cache/does-not-exist.xml"; - thrown.expect(BeanCreationException.class); - thrown.expectMessage("spring.cache.config"); - thrown.expectMessage(configLocation); + this.thrown.expect(BeanCreationException.class); + this.thrown.expectMessage("spring.cache.config"); + this.thrown.expectMessage(configLocation); load(JCacheCustomConfiguration.class, "spring.cache.type=jcache", "spring.cache.jcache.provider=" + cachingProviderFqn, "spring.cache.config=" + configLocation); @@ -367,11 +367,12 @@ public class CacheAutoConfigurationTests { try { load(DefaultCacheConfiguration.class, "spring.cache.type=jcache", "spring.cache.jcache.provider=" + cachingProviderFqn, - "spring.cache.config="+configLocation); + "spring.cache.config=" + configLocation); cacheManager = validateCacheManager(JCacheCacheManager.class); Resource configResource = new ClassPathResource(configLocation); - assertThat(cacheManager.getCacheManager().getURI(), is(configResource.getURI())); + assertThat(cacheManager.getCacheManager().getURI(), + is(configResource.getURI())); } finally { if (cacheManager != null) { diff --git a/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java b/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java index dbf825c758..61d71eb60b 100644 --- a/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java +++ b/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java @@ -42,7 +42,8 @@ public class CommandLineIT { InterruptedException { Invocation cli = this.cli.invoke("hint"); assertThat(cli.await(), equalTo(0)); - assertThat("Unexpected error: \n" + cli.getErrorOutput(), cli.getErrorOutput().length(), equalTo(0)); + assertThat("Unexpected error: \n" + cli.getErrorOutput(), cli.getErrorOutput() + .length(), equalTo(0)); assertThat(cli.getStandardOutputLines().size(), equalTo(10)); }