|
|
@ -48,8 +48,6 @@ import de.flapdoodle.embed.process.store.ArtifactStoreBuilder;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.BeanFactoryUtils;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.ListableBeanFactory;
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
@ -218,32 +216,26 @@ public class EmbeddedMongoAutoConfiguration {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnClass({ MongoClient.class, MongoClientFactoryBean.class })
|
|
|
|
@ConditionalOnClass({ MongoClient.class, MongoClientFactoryBean.class })
|
|
|
|
protected static class EmbeddedMongoDependencyConfiguration {
|
|
|
|
protected static class EmbeddedMongoDependencyConfiguration extends MongoClientDependsOnBeanFactoryPostProcessor {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
EmbeddedMongoDependencyConfiguration() {
|
|
|
|
public MongoClientDependsOnBeanFactoryPostProcessor mongoClientDependsOnBeanFactoryPostProcessor(
|
|
|
|
super(MongodExecutable.class);
|
|
|
|
ListableBeanFactory listableBeanFactory) {
|
|
|
|
|
|
|
|
String[] mongoExecutableBeanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(listableBeanFactory,
|
|
|
|
|
|
|
|
MongodExecutable.class);
|
|
|
|
|
|
|
|
return new MongoClientDependsOnBeanFactoryPostProcessor(mongoExecutableBeanNames);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Additional configuration to ensure that {@link MongoClient} beans depend on any
|
|
|
|
* Additional configuration to ensure that
|
|
|
|
|
|
|
|
* {@link com.mongodb.reactivestreams.client.MongoClient} beans depend on any
|
|
|
|
* {@link MongodExecutable} beans.
|
|
|
|
* {@link MongodExecutable} beans.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnClass({ com.mongodb.reactivestreams.client.MongoClient.class, ReactiveMongoClientFactoryBean.class })
|
|
|
|
@ConditionalOnClass({ com.mongodb.reactivestreams.client.MongoClient.class, ReactiveMongoClientFactoryBean.class })
|
|
|
|
protected static class EmbeddedReactiveMongoDependencyConfiguration {
|
|
|
|
protected static class EmbeddedReactiveMongoDependencyConfiguration
|
|
|
|
|
|
|
|
extends ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
EmbeddedReactiveMongoDependencyConfiguration() {
|
|
|
|
public ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor reactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor(
|
|
|
|
super(MongodExecutable.class);
|
|
|
|
ListableBeanFactory listableBeanFactory) {
|
|
|
|
|
|
|
|
String[] mongoExecutableBeanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(listableBeanFactory,
|
|
|
|
|
|
|
|
MongodExecutable.class);
|
|
|
|
|
|
|
|
return new ReactiveStreamsMongoClientDependsOnBeanFactoryPostProcessor(mongoExecutableBeanNames);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|