Polish "Make sure Hazelcast shutdown logs are available"

See gh-32184
pull/32861/head
Stephane Nicoll 2 years ago
parent 24f3b2b1b7
commit 960b034875

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

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

Loading…
Cancel
Save