diff --git a/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfiguration.java b/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfiguration.java index cbac6876..46195eca 100644 --- a/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfiguration.java +++ b/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfiguration.java @@ -35,12 +35,13 @@ import org.springframework.scheduling.annotation.EnableScheduling; */ @EnableScheduling @EnableConfigurationProperties(MomentsProperties.class) -@ConditionalOnProperty(name = "moduliths.moments.enabled", havingValue = "true", matchIfMissing = true) +@ConditionalOnProperty(name = "spring.modulith.moments.enabled", havingValue = "true", matchIfMissing = true) @Configuration(proxyBeanMethods = false) class MomentsAutoConfiguration { @Bean - @ConditionalOnProperty(name = "moduliths.moments.enable-time-machine", havingValue = "false", matchIfMissing = true) + @ConditionalOnProperty(name = "spring.modulith.moments.enable-time-machine", havingValue = "false", + matchIfMissing = true) Moments moments(ObjectProvider clockProvider, ApplicationEventPublisher events, MomentsProperties properties) { Clock clock = clockProvider.getIfAvailable(() -> Clock.systemUTC()); @@ -49,7 +50,8 @@ class MomentsAutoConfiguration { } @Bean - @ConditionalOnProperty(name = "moduliths.moments.enable-time-machine", havingValue = "true", matchIfMissing = false) + @ConditionalOnProperty(name = "spring.modulith.moments.enable-time-machine", havingValue = "true", + matchIfMissing = false) TimeMachine timeMachine(ObjectProvider clockProvider, ApplicationEventPublisher events, MomentsProperties properties) { diff --git a/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/support/MomentsProperties.java b/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/support/MomentsProperties.java index cf2801f7..455e31a5 100644 --- a/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/support/MomentsProperties.java +++ b/spring-modulith-moments/src/main/java/org/springframework/modulith/moments/support/MomentsProperties.java @@ -42,7 +42,7 @@ import org.springframework.util.Assert; * * @author Oliver Drotbohm */ -@ConfigurationProperties(prefix = "moduliths.moments") +@ConfigurationProperties(prefix = "spring.modulith.moments") @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public class MomentsProperties { diff --git a/spring-modulith-moments/src/test/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfigurationTests.java b/spring-modulith-moments/src/test/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfigurationTests.java index b212715c..1637df7f 100644 --- a/spring-modulith-moments/src/test/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfigurationTests.java +++ b/spring-modulith-moments/src/test/java/org/springframework/modulith/moments/autoconfigure/MomentsAutoConfigurationTests.java @@ -51,7 +51,7 @@ class MomentsAutoConfigurationTests { new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(MomentsAutoConfiguration.class)) - .withPropertyValues("moduliths.moments.zone-id:Europe/Berlin") + .withPropertyValues("spring.modulith.moments.zone-id:Europe/Berlin") .run(it -> { assertThat(it).getBean(MomentsProperties.class) .extracting(MomentsProperties::getZoneId) @@ -64,7 +64,7 @@ class MomentsAutoConfigurationTests { new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(MomentsAutoConfiguration.class)) - .withPropertyValues("moduliths.moments.quarter-start-month=February") + .withPropertyValues("spring.modulith.moments.quarter-start-month=February") .run(it -> { assertThat(it).getBean(MomentsProperties.class).satisfies(props -> { assertThat(props.getShiftedQuarter(LocalDate.of(2022, 1, 1)).getQuarter()).isEqualTo(Quarter.Q4); @@ -77,7 +77,7 @@ class MomentsAutoConfigurationTests { new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(MomentsAutoConfiguration.class)) - .withPropertyValues("moduliths.moments.enabled=false") + .withPropertyValues("spring.modulith.moments.enabled=false") .run(it -> { assertThat(it).doesNotHaveBean(Moments.class); assertThat(it).doesNotHaveBean(MomentsProperties.class); @@ -89,7 +89,7 @@ class MomentsAutoConfigurationTests { new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(MomentsAutoConfiguration.class)) - .withPropertyValues("moduliths.moments.enable-time-machine=true") + .withPropertyValues("spring.modulith.moments.enable-time-machine=true") .run(it -> { assertThat(it).hasSingleBean(TimeMachine.class); });