From 77bdf992ec3b9dd2ed12e54ed1c9898fac0b686d Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 10 Feb 2020 11:41:10 +0100 Subject: [PATCH] Polish "Create HazelCastClient if necessary" See gh-20109 --- .../hazelcast/HazelcastAutoConfigurationClientTests.java | 4 +++- .../autoconfigure/hazelcast/hazelcast-client-instance.xml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java index f63dce65fba..2369424d771 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationClientTests.java @@ -16,6 +16,7 @@ package org.springframework.boot.autoconfigure.hazelcast; +import com.hazelcast.client.HazelcastClient; import com.hazelcast.client.config.ClientConfig; import com.hazelcast.client.impl.clientside.HazelcastClientProxy; import com.hazelcast.config.Config; @@ -125,7 +126,8 @@ class HazelcastAutoConfigurationClientTests { } @Test - void clientConfigWithInstanceName() { + void clientConfigWithInstanceNameCreatesClientIfNecessary() { + assertThat(HazelcastClient.getHazelcastClientByName("spring-boot")).isNull(); this.contextRunner .withPropertyValues("spring.hazelcast.config=classpath:org/springframework/" + "boot/autoconfigure/hazelcast/hazelcast-client-instance.xml") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-instance.xml b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-instance.xml index 29bfac076ac..0dbc09b64fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-instance.xml +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-client-instance.xml @@ -4,4 +4,5 @@ xsi:schemaLocation="http://www.hazelcast.com/schema/client-config hazelcast-client-config-3.12.xsd"> spring-boot +