|
25 | 25 | import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
|
26 | 26 | import org.springframework.boot.autoconfigure.data.jpa.city.City;
|
27 | 27 | import org.springframework.boot.autoconfigure.data.jpa.city.CityRepository;
|
28 |
| -import org.springframework.boot.autoconfigure.data.mongo.MixedMongoRepositoriesAutoConfigurationTests.BaseConfiguration.Registrar; |
29 | 28 | import org.springframework.boot.autoconfigure.data.mongo.country.Country;
|
30 | 29 | import org.springframework.boot.autoconfigure.data.mongo.country.CountryRepository;
|
31 | 30 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
@@ -112,28 +111,6 @@ public void testJpaRepositoryConfigurationWithMongoOverlapDisabled() throws Exce
|
112 | 111 | assertNotNull(this.context.getBean(CityRepository.class));
|
113 | 112 | }
|
114 | 113 |
|
115 |
| - @Configuration |
116 |
| - @Import(Registrar.class) |
117 |
| - protected static class BaseConfiguration { |
118 |
| - |
119 |
| - protected static class Registrar implements ImportSelector { |
120 |
| - |
121 |
| - @Override |
122 |
| - public String[] selectImports(AnnotationMetadata importingClassMetadata) { |
123 |
| - List<String> names = new ArrayList<String>(); |
124 |
| - for (Class<?> type : new Class<?>[] { DataSourceAutoConfiguration.class, |
125 |
| - HibernateJpaAutoConfiguration.class, |
126 |
| - JpaRepositoriesAutoConfiguration.class, |
127 |
| - MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, |
128 |
| - MongoRepositoriesAutoConfiguration.class }) { |
129 |
| - names.add(type.getName()); |
130 |
| - } |
131 |
| - return names.toArray(new String[0]); |
132 |
| - } |
133 |
| - } |
134 |
| - |
135 |
| - } |
136 |
| - |
137 | 114 | @Configuration
|
138 | 115 | @TestAutoConfigurationPackage(MongoAutoConfigurationTests.class)
|
139 | 116 | // Not this package or its parent
|
@@ -167,4 +144,27 @@ protected static class JpaConfiguration {
|
167 | 144 | protected static class OverlapConfiguration {
|
168 | 145 |
|
169 | 146 | }
|
| 147 | + |
| 148 | + @Configuration |
| 149 | + @Import(Registrar.class) |
| 150 | + protected static class BaseConfiguration { |
| 151 | + |
| 152 | + } |
| 153 | + |
| 154 | + protected static class Registrar implements ImportSelector { |
| 155 | + |
| 156 | + @Override |
| 157 | + public String[] selectImports(AnnotationMetadata importingClassMetadata) { |
| 158 | + List<String> names = new ArrayList<String>(); |
| 159 | + for (Class<?> type : new Class<?>[] { DataSourceAutoConfiguration.class, |
| 160 | + HibernateJpaAutoConfiguration.class, |
| 161 | + JpaRepositoriesAutoConfiguration.class, MongoAutoConfiguration.class, |
| 162 | + MongoDataAutoConfiguration.class, |
| 163 | + MongoRepositoriesAutoConfiguration.class }) { |
| 164 | + names.add(type.getName()); |
| 165 | + } |
| 166 | + return names.toArray(new String[0]); |
| 167 | + } |
| 168 | + } |
| 169 | + |
170 | 170 | }
|
0 commit comments