Prevent double registration of event publisher registrar
See gh-39297
This commit is contained in:
parent
8c18d75b12
commit
50c44e301a
|
@ -115,7 +115,7 @@ public class TestcontainersPropertySource extends EnumerablePropertySource<Map<S
|
|||
if (eventPublisher != null) {
|
||||
propertySource.addEventPublisher(eventPublisher);
|
||||
}
|
||||
else if (registry != null) {
|
||||
else if (registry != null && !registry.containsBeanDefinition(EventPublisherRegistrar.NAME)) {
|
||||
registry.registerBeanDefinition(EventPublisherRegistrar.NAME, new RootBeanDefinition(
|
||||
EventPublisherRegistrar.class, () -> new EventPublisherRegistrar(environment)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue