Rename MongoTemplateAutoConfiguration
Rename MongoTemplateAutoConfiguration to MongoDataAutoConfiguration since it now configures more than just the template.
This commit is contained in:
		
							parent
							
								
									a7f5cbf7d0
								
							
						
					
					
						commit
						5dabd7fb41
					
				|  | @ -47,7 +47,7 @@ import com.mongodb.Mongo; | ||||||
|  */ |  */ | ||||||
| @Configuration | @Configuration | ||||||
| @ConditionalOnClass({ Mongo.class, MongoTemplate.class }) | @ConditionalOnClass({ Mongo.class, MongoTemplate.class }) | ||||||
| public class MongoTemplateAutoConfiguration { | public class MongoDataAutoConfiguration { | ||||||
| 
 | 
 | ||||||
| 	@Autowired | 	@Autowired | ||||||
| 	private MongoProperties properties; | 	private MongoProperties properties; | ||||||
|  | @ -21,7 +21,7 @@ org.springframework.boot.autoconfigure.jms.JmsTemplateAutoConfiguration,\ | ||||||
| org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration,\ | org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration,\ | ||||||
| org.springframework.boot.autoconfigure.mobile.DeviceResolverAutoConfiguration,\ | org.springframework.boot.autoconfigure.mobile.DeviceResolverAutoConfiguration,\ | ||||||
| org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration,\ | org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration,\ | ||||||
| org.springframework.boot.autoconfigure.mongo.MongoTemplateAutoConfiguration,\ | org.springframework.boot.autoconfigure.mongo.MongoDataAutoConfiguration,\ | ||||||
| org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,\ | org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,\ | ||||||
| org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration,\ | org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration,\ | ||||||
| org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration,\ | org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration,\ | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.data.alt.CityMongoDbRepository; | ||||||
| import org.springframework.boot.autoconfigure.data.mongo.City; | import org.springframework.boot.autoconfigure.data.mongo.City; | ||||||
| import org.springframework.boot.autoconfigure.data.mongo.CityRepository; | import org.springframework.boot.autoconfigure.data.mongo.CityRepository; | ||||||
| import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; | import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; | ||||||
| import org.springframework.boot.autoconfigure.mongo.MongoTemplateAutoConfiguration; | import org.springframework.boot.autoconfigure.mongo.MongoDataAutoConfiguration; | ||||||
| import org.springframework.context.annotation.AnnotationConfigApplicationContext; | import org.springframework.context.annotation.AnnotationConfigApplicationContext; | ||||||
| import org.springframework.context.annotation.Configuration; | import org.springframework.context.annotation.Configuration; | ||||||
| import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; | import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; | ||||||
|  | @ -51,7 +51,7 @@ public class MongoRepositoriesAutoConfigurationTests { | ||||||
| 		this.context = new AnnotationConfigApplicationContext(); | 		this.context = new AnnotationConfigApplicationContext(); | ||||||
| 		this.context.register(TestConfiguration.class, MongoAutoConfiguration.class, | 		this.context.register(TestConfiguration.class, MongoAutoConfiguration.class, | ||||||
| 				MongoRepositoriesAutoConfiguration.class, | 				MongoRepositoriesAutoConfiguration.class, | ||||||
| 				MongoTemplateAutoConfiguration.class, | 				MongoDataAutoConfiguration.class, | ||||||
| 				PropertyPlaceholderAutoConfiguration.class); | 				PropertyPlaceholderAutoConfiguration.class); | ||||||
| 		this.context.refresh(); | 		this.context.refresh(); | ||||||
| 		assertNotNull(this.context.getBean(CityRepository.class)); | 		assertNotNull(this.context.getBean(CityRepository.class)); | ||||||
|  | @ -65,7 +65,7 @@ public class MongoRepositoriesAutoConfigurationTests { | ||||||
| 		this.context = new AnnotationConfigApplicationContext(); | 		this.context = new AnnotationConfigApplicationContext(); | ||||||
| 		this.context.register(EmptyConfiguration.class, MongoAutoConfiguration.class, | 		this.context.register(EmptyConfiguration.class, MongoAutoConfiguration.class, | ||||||
| 				MongoRepositoriesAutoConfiguration.class, | 				MongoRepositoriesAutoConfiguration.class, | ||||||
| 				MongoTemplateAutoConfiguration.class, | 				MongoDataAutoConfiguration.class, | ||||||
| 				PropertyPlaceholderAutoConfiguration.class); | 				PropertyPlaceholderAutoConfiguration.class); | ||||||
| 		this.context.refresh(); | 		this.context.refresh(); | ||||||
| 
 | 
 | ||||||
|  | @ -78,7 +78,7 @@ public class MongoRepositoriesAutoConfigurationTests { | ||||||
| 		this.context = new AnnotationConfigApplicationContext(); | 		this.context = new AnnotationConfigApplicationContext(); | ||||||
| 		this.context.register(CustomizedConfiguration.class, | 		this.context.register(CustomizedConfiguration.class, | ||||||
| 				MongoAutoConfiguration.class, MongoRepositoriesAutoConfiguration.class, | 				MongoAutoConfiguration.class, MongoRepositoriesAutoConfiguration.class, | ||||||
| 				MongoTemplateAutoConfiguration.class, | 				MongoDataAutoConfiguration.class, | ||||||
| 				PropertyPlaceholderAutoConfiguration.class); | 				PropertyPlaceholderAutoConfiguration.class); | ||||||
| 		this.context.refresh(); | 		this.context.refresh(); | ||||||
| 		assertNotNull(this.context.getBean(CityMongoDbRepository.class)); | 		assertNotNull(this.context.getBean(CityMongoDbRepository.class)); | ||||||
|  |  | ||||||
|  | @ -44,7 +44,7 @@ public class MongoAutoConfigurationTests { | ||||||
| 	public void templateExists() { | 	public void templateExists() { | ||||||
| 		this.context = new AnnotationConfigApplicationContext( | 		this.context = new AnnotationConfigApplicationContext( | ||||||
| 				PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class, | 				PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class, | ||||||
| 				MongoTemplateAutoConfiguration.class); | 				MongoDataAutoConfiguration.class); | ||||||
| 		assertEquals(1, this.context.getBeanNamesForType(MongoTemplate.class).length); | 		assertEquals(1, this.context.getBeanNamesForType(MongoTemplate.class).length); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -25,11 +25,11 @@ import org.springframework.data.mongodb.gridfs.GridFsTemplate; | ||||||
| import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Tests for {@link MongoTemplateAutoConfiguration}. |  * Tests for {@link MongoDataAutoConfiguration}. | ||||||
|  *  |  *  | ||||||
|  * @author Josh Long |  * @author Josh Long | ||||||
|  */ |  */ | ||||||
| public class MongoTemplateAutoConfigurationTests { | public class MongoDataAutoConfigurationTests { | ||||||
| 
 | 
 | ||||||
| 	private AnnotationConfigApplicationContext context; | 	private AnnotationConfigApplicationContext context; | ||||||
| 
 | 
 | ||||||
|  | @ -44,7 +44,7 @@ public class MongoTemplateAutoConfigurationTests { | ||||||
| 	public void templateExists() { | 	public void templateExists() { | ||||||
| 		this.context = new AnnotationConfigApplicationContext( | 		this.context = new AnnotationConfigApplicationContext( | ||||||
| 				PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class, | 				PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class, | ||||||
| 				MongoTemplateAutoConfiguration.class); | 				MongoDataAutoConfiguration.class); | ||||||
| 		assertEquals(1, this.context.getBeanNamesForType(GridFsTemplate.class).length); | 		assertEquals(1, this.context.getBeanNamesForType(GridFsTemplate.class).length); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
		Loading…
	
		Reference in New Issue