Browse Source

Disable auto-detection in tests that start Hazelcast

This commit updates test configurations to disable auto-detection of
Hazelcast instances.

See gh-31863
pull/31958/head
Adrian Bob 3 years ago committed by Stephane Nicoll
parent
commit
aad9c8906a
  1. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/hazelcast.xml
  2. 1
      spring-boot-project/spring-boot-actuator/src/test/resources/hazelcast.xml
  3. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationServerTests.java
  4. 1
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/hazelcast.xml
  5. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/hazelcast.yaml
  6. 1
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml
  7. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yaml

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/hazelcast.xml

@ -5,6 +5,7 @@
<map name="defaultCache" /> <map name="defaultCache" />
<network> <network>
<join> <join>
<auto-detection enabled="false"/>
<multicast enabled="false"/> <multicast enabled="false"/>
</join> </join>
</network> </network>

1
spring-boot-project/spring-boot-actuator/src/test/resources/hazelcast.xml

@ -6,6 +6,7 @@
<map name="defaultCache" /> <map name="defaultCache" />
<network> <network>
<join> <join>
<auto-detection enabled="false" />
<multicast enabled="false"/> <multicast enabled="false"/>
</join> </join>
</network> </network>

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationServerTests.java

@ -131,6 +131,7 @@ class HazelcastAutoConfigurationServerTests {
@Test @Test
void configInstanceWithName() { void configInstanceWithName() {
Config config = new Config("my-test-instance"); Config config = new Config("my-test-instance");
config.getNetworkConfig().getJoin().getAutoDetectionConfig().setEnabled(false);
HazelcastInstance existing = Hazelcast.newHazelcastInstance(config); HazelcastInstance existing = Hazelcast.newHazelcastInstance(config);
try { try {
this.contextRunner.withUserConfiguration(HazelcastConfigWithName.class) this.contextRunner.withUserConfiguration(HazelcastConfigWithName.class)
@ -180,6 +181,7 @@ class HazelcastAutoConfigurationServerTests {
@Bean @Bean
Config anotherHazelcastConfig() { Config anotherHazelcastConfig() {
Config config = new Config(); Config config = new Config();
config.getNetworkConfig().getJoin().getAutoDetectionConfig().setEnabled(false);
config.addQueueConfig(new QueueConfig("another-queue")); config.addQueueConfig(new QueueConfig("another-queue"));
return config; return config;
} }

1
spring-boot-project/spring-boot-autoconfigure/src/test/resources/hazelcast.xml

@ -5,6 +5,7 @@
<map name="defaultCache" /> <map name="defaultCache" />
<network> <network>
<join> <join>
<auto-detection enabled="false" />
<multicast enabled="false" /> <multicast enabled="false" />
</join> </join>
</network> </network>

2
spring-boot-project/spring-boot-autoconfigure/src/test/resources/hazelcast.yaml

@ -1,5 +1,7 @@
hazelcast: hazelcast:
network: network:
join: join:
auto-detection:
enabled: false
multicast: multicast:
enabled: false enabled: false

1
spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml

@ -11,6 +11,7 @@
<network> <network>
<join> <join>
<auto-detection enabled="false" />
<multicast enabled="false"/> <multicast enabled="false"/>
</join> </join>
</network> </network>

2
spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.yaml

@ -1,6 +1,8 @@
hazelcast: hazelcast:
network: network:
join: join:
auto-detection:
enabled: false
multicast: multicast:
enabled: false enabled: false

Loading…
Cancel
Save