Deprecate spring.cache.hazelcast.config

The additional configuration for an `HazelcastInstance` will be removed
in 2.0. This commit makes sure that the property is deprecated in 1.5

See gh-8470
This commit is contained in:
Stephane Nicoll
2017-03-03 10:29:39 +01:00
parent d4b52a3538
commit bb8800a625
4 changed files with 8 additions and 13 deletions

View File

@@ -88,6 +88,7 @@ public class CacheProperties {
return this.ehcache;
}
@Deprecated
public Hazelcast getHazelcast() {
return this.hazelcast;
}
@@ -193,6 +194,7 @@ public class CacheProperties {
/**
* Hazelcast specific cache properties.
*/
@Deprecated
public static class Hazelcast {
/**
@@ -200,6 +202,9 @@ public class CacheProperties {
*/
private Resource config;
@DeprecatedConfigurationProperty(replacement = "spring.hazelcast.config",
reason = "Use general hazelcast auto-configuration instead.")
@Deprecated
public Resource getConfig() {
return this.config;
}

View File

@@ -451,6 +451,7 @@ public class CacheAutoConfigurationTests {
}
@Test
@Deprecated
public void hazelcastCacheWithConfig() throws IOException {
load(DefaultCacheConfiguration.class, "spring.cache.type=hazelcast",
"spring.cache.hazelcast.config=org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml");
@@ -469,6 +470,7 @@ public class CacheAutoConfigurationTests {
}
@Test
@Deprecated
public void hazelcastWithWrongConfig() {
this.thrown.expect(BeanCreationException.class);
this.thrown.expectMessage("foo/bar/unknown.xml");
@@ -505,6 +507,7 @@ public class CacheAutoConfigurationTests {
}
@Test
@Deprecated
public void hazelcastCacheWithMainHazelcastAutoConfigurationAndSeparateCacheConfig()
throws IOException {
String mainConfig = "org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml";