use of org.springframework.boot.autoconfigure.TestAutoConfigurationSorter in project spring-boot by spring-projects.
the class CloudAutoConfigurationTests method testOrder.
@Test
public void testOrder() throws Exception {
TestAutoConfigurationSorter sorter = new TestAutoConfigurationSorter(new CachingMetadataReaderFactory());
Collection<String> classNames = new ArrayList<>();
classNames.add(MongoAutoConfiguration.class.getName());
classNames.add(DataSourceAutoConfiguration.class.getName());
classNames.add(MongoRepositoriesAutoConfiguration.class.getName());
classNames.add(JpaRepositoriesAutoConfiguration.class.getName());
classNames.add(CloudAutoConfiguration.class.getName());
List<String> ordered = sorter.getInPriorityOrder(classNames);
assertThat(ordered.get(0)).isEqualTo(CloudAutoConfiguration.class.getName());
}
Aggregations