Browse Source

Polish "Make sure Hazelcast shutdown logs are available"

See gh-32184
pull/32861/head
Stephane Nicoll 3 years ago
parent
commit
960b034875
  1. 3
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration.java
  2. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastAutoConfigurationServerTests.java

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

@ -51,6 +51,7 @@ import org.springframework.util.StringUtils; @@ -51,6 +51,7 @@ import org.springframework.util.StringUtils;
class HazelcastServerConfiguration {
static final String CONFIG_SYSTEM_PROPERTY = "hazelcast.config";
static final String HAZELCAST_LOGGING_TYPE = "hazelcast.logging.type";
private static HazelcastInstance getHazelcastInstance(Config config) {
@ -126,7 +127,7 @@ class HazelcastServerConfiguration { @@ -126,7 +127,7 @@ class HazelcastServerConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(org.slf4j.Logger.class)
static class LoggingHazelcastConfigCustomizerConfiguration {
static class HazelcastLoggingConfigCustomizerConfiguration {
@Bean
@Order(0)

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

@ -207,7 +207,7 @@ class HazelcastAutoConfigurationServerTests { @@ -207,7 +207,7 @@ class HazelcastAutoConfigurationServerTests {
}
@Test
void configWithDefaultLoggingTypeSlf4j() {
void autoConfiguredConfigSetsHazelcastLoggingToSlf4j() {
this.contextRunner.run((context) -> {
Config config = context.getBean(HazelcastInstance.class).getConfig();
assertThat(config.getProperty(HazelcastServerConfiguration.HAZELCAST_LOGGING_TYPE)).isEqualTo("slf4j");
@ -215,7 +215,7 @@ class HazelcastAutoConfigurationServerTests { @@ -215,7 +215,7 @@ class HazelcastAutoConfigurationServerTests {
}
@Test
void configWithExplicitLoggingType() {
void autoConfiguredConfigCanOverrideHazelcastLogging() {
this.contextRunner.withUserConfiguration(HazelcastConfigWithJDKLogging.class).run((context) -> {
Config config = context.getBean(HazelcastInstance.class).getConfig();
assertThat(config.getProperty(HazelcastServerConfiguration.HAZELCAST_LOGGING_TYPE)).isEqualTo("jdk");

Loading…
Cancel
Save