Skip to content

Commit

Permalink
Polish "Make sure Hazelcast shutdown logs are available"
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Sep 7, 2022
1 parent 24f3b2b commit 960b034
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -51,6 +51,7 @@
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) {
Expand Down Expand Up @@ -126,7 +127,7 @@ HazelcastConfigCustomizer springManagedContextHazelcastConfigCustomizer(Applicat

@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(org.slf4j.Logger.class)
static class LoggingHazelcastConfigCustomizerConfiguration {
static class HazelcastLoggingConfigCustomizerConfiguration {

@Bean
@Order(0)
Expand Down
Expand Up @@ -207,15 +207,15 @@ void autoConfiguredContextCanOverrideManagementContextUsingCustomizer() {
}

@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");
});
}

@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");
Expand Down

0 comments on commit 960b034

Please sign in to comment.