Java 类org.springframework.boot.autoconfigure.packagestest.two.SecondConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationPackagesTests.java   
@Test
public void detectsMultipleAutoConfigurationPackages() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            FirstConfiguration.class, SecondConfiguration.class);
    List<String> packages = AutoConfigurationPackages.get(context.getBeanFactory());
    Package package1 = FirstConfiguration.class.getPackage();
    Package package2 = SecondConfiguration.class.getPackage();
    assertThat(packages).containsOnly(package1.getName(), package2.getName());
}
项目:spring-boot-concourse    文件:AutoConfigurationPackagesTests.java   
@Test
public void detectsMultipleAutoConfigurationPackages() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            FirstConfiguration.class, SecondConfiguration.class);
    List<String> packages = AutoConfigurationPackages.get(context.getBeanFactory());
    Package package1 = FirstConfiguration.class.getPackage();
    Package package2 = SecondConfiguration.class.getPackage();
    assertThat(packages).containsOnly(package1.getName(), package2.getName());
}
项目:contestparser    文件:AutoConfigurationPackagesTests.java   
@Test
public void detectsMultipleAutoConfigurationPackages() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
            FirstConfiguration.class, SecondConfiguration.class);
    List<String> packages = AutoConfigurationPackages.get(context.getBeanFactory());
    Package package1 = FirstConfiguration.class.getPackage();
    Package package2 = SecondConfiguration.class.getPackage();
    assertThat(packages, hasItems(package1.getName(), package2.getName()));
    assertThat(packages, hasSize(2));
}