Skip to content

Commit 77bdf99

Browse files
committed
Polish "Create HazelCastClient if necessary"
See gh-20109
1 parent 67dd9ad commit 77bdf99

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.autoconfigure.hazelcast;
1818

19+
import com.hazelcast.client.HazelcastClient;
1920
import com.hazelcast.client.config.ClientConfig;
2021
import com.hazelcast.client.impl.clientside.HazelcastClientProxy;
2122
import com.hazelcast.config.Config;
@@ -125,7 +126,8 @@ void clientConfigTakesPrecedence() {
125126
}
126127

127128
@Test
128-
void clientConfigWithInstanceName() {
129+
void clientConfigWithInstanceNameCreatesClientIfNecessary() {
130+
assertThat(HazelcastClient.getHazelcastClientByName("spring-boot")).isNull();
129131
this.contextRunner
130132
.withPropertyValues("spring.hazelcast.config=classpath:org/springframework/"
131133
+ "boot/autoconfigure/hazelcast/hazelcast-client-instance.xml")

spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-instance.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
xsi:schemaLocation="http://www.hazelcast.com/schema/client-config hazelcast-client-config-3.12.xsd">
55

66
<instance-name>spring-boot</instance-name>
7+
78
</hazelcast-client>

0 commit comments

Comments
 (0)