org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MongoTracingAutoConfigurationTest.java    From java-spring-cloud with Apache License 2.0 5 votes vote down vote up
@Test
public void createsTracingPostProcessor() {
  final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
      .withPropertyValues("spring.data.mongodb.port=27017") // Otherwise a random embedded mongo port is used
      .withConfiguration(UserConfigurations.of(TracerConfig.class, MongoConfig.class))
      .withConfiguration(AutoConfigurations.of(
          MongoTracingAutoConfiguration.class,
          EmbeddedMongoAutoConfiguration.class
      ));

  contextRunner.run(context -> Assertions.assertThat(context).hasSingleBean(TracingMongoClientPostProcessor.class));
}
 
Example #2
Source File: MongoTracingAutoConfigurationTest.java    From java-spring-cloud with Apache License 2.0 5 votes vote down vote up
@Test
public void createsTracingPostProcessorWhenAutoConfigured() {
  final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
      .withPropertyValues("spring.data.mongodb.port=27017") // Otherwise a random embedded mongo port is used
      .withConfiguration(AutoConfigurations.of(
          MongoTracingAutoConfiguration.class,
          TracerAutoConfiguration.class,
          MongoAutoConfiguration.class,
          EmbeddedMongoAutoConfiguration.class
      ));

  contextRunner.run(context -> Assertions.assertThat(context).hasSingleBean(TracingMongoClientPostProcessor.class));
}