Skip to content

Commit 19c69ff

Browse files
committed
Polish "Add support for detecting .yml Hazelcast config files"
See gh-32142
1 parent 5eaafde commit 19c69ff

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfigAvailableCondition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastClientConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -105,10 +105,8 @@ void explicitConfigFileWithYaml() {
105105

106106
@Test
107107
void explicitConfigFileWithYml() {
108-
this.contextRunner
109-
.withPropertyValues("spring.hazelcast.config=org/springframework/boot/autoconfigure/"
110-
+ "hazelcast/hazelcast-client-specific.yml")
111-
.run(assertSpecificHazelcastClient("explicit-yml"));
108+
this.contextRunner.withPropertyValues("spring.hazelcast.config=org/springframework/boot/autoconfigure/"
109+
+ "hazelcast/hazelcast-client-specific.yml").run(assertSpecificHazelcastClient("explicit-yml"));
112110
}
113111

114112
@Test

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ class HazelcastAutoConfigurationTests {
4545
void defaultConfigFile() {
4646
// no hazelcast-client.xml and hazelcast.xml is present in root classpath
4747
// this also asserts that XML has priority over YAML
48-
// as both hazelcast.yaml, hazelcast.yml and hazelcast.xml in test classpath.
48+
// as hazelcast.yaml, hazelcast.yml, and hazelcast.xml are available.
4949
this.contextRunner.run((context) -> {
5050
Config config = context.getBean(HazelcastInstance.class).getConfig();
5151
assertThat(config.getConfigurationUrl()).isEqualTo(new ClassPathResource("hazelcast.xml").getURL());

spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/hazelcast.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Spring Boot first attempts to create a client by checking the following configur
88
* A configuration file defined by the configprop:spring.hazelcast.config[] property.
99
* The presence of the `hazelcast.client.config` system property.
1010
* A `hazelcast-client.xml` in the working directory or at the root of the classpath.
11-
* A `hazelcast-client.yaml` in the working directory or at the root of the classpath.
11+
* A `hazelcast-client.yaml` (or `hazelcast-client.yml`) in the working directory or at the root of the classpath.
1212

1313
NOTE: Spring Boot supports both Hazelcast 4 and Hazelcast 3.
1414
If you downgrade to Hazelcast 3, `hazelcast-client` should be added to the classpath to configure a client.
@@ -26,7 +26,7 @@ You could also specify the Hazelcast configuration file to use through configura
2626
config: "classpath:config/my-hazelcast.xml"
2727
----
2828

29-
Otherwise, Spring Boot tries to find the Hazelcast configuration from the default locations: `hazelcast.xml` in the working directory or at the root of the classpath, or a `.yaml` counterpart in the same locations.
29+
Otherwise, Spring Boot tries to find the Hazelcast configuration from the default locations: `hazelcast.xml` in the working directory or at the root of the classpath, or a `.yaml`/`.yml` counterpart in the same locations.
3030
We also check if the `hazelcast.config` system property is set.
3131
See the https://docs.hazelcast.org/docs/latest/manual/html-single/[Hazelcast documentation] for more details.
3232

0 commit comments

Comments
 (0)