Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class EventPublicationAutoConfiguration extends EventPublicationConfigura
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnBean(EventPublicationRepository.class)
@ConditionalOnMissingBean
EventPublicationRegistry eventPublicationRegistry(EventPublicationRepository repository,
ObjectProvider<Clock> clock) {
return super.eventPublicationRegistry(repository, clock);
Expand All @@ -70,6 +71,7 @@ EventPublicationRegistry eventPublicationRegistry(EventPublicationRepository rep
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnBean(EventPublicationRegistry.class)
@ConditionalOnMissingBean
static PersistentApplicationEventMulticaster applicationEventMulticaster(
ObjectFactory<EventPublicationRegistry> eventPublicationRegistry, ObjectFactory<Environment> environment) {

Expand All @@ -79,6 +81,7 @@ static PersistentApplicationEventMulticaster applicationEventMulticaster(
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnBean(EventPublicationRegistry.class)
@ConditionalOnMissingBean
static CompletionRegisteringAdvisor completionRegisteringAdvisor(ObjectFactory<EventPublicationRegistry> registry) {
return EventPublicationConfiguration.completionRegisteringAdvisor(registry);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ void exposesCompletedAndIncompleteEventPublications() {
});
}

@Test // GH-374
void compatibleWithEnablePersistentDomainEvents() {
basicSetup()
.withUserConfiguration(EnablePersistentDomainEventConfiguration.class)
.run(context -> {
assertThat(context).hasNotFailed();
});
}

private static <T> ContextConsumer<AssertableApplicationContext> expect(Function<Shutdown, T> extractor,
@Nullable T expected) {

Expand All @@ -155,4 +164,7 @@ private ApplicationContextRunner basicSetup() {

@EnableAsync(mode = AdviceMode.ASPECTJ)
static class CustomAsyncConfiguration {}

@EnablePersistentDomainEvents
static class EnablePersistentDomainEventConfiguration {}
}