コード例 #1
0
 @Test
 public void doubleAdd() throws Exception {
   List<String> list1 = Arrays.asList("com.mycorp.test1", "com.mycorp.test2");
   List<String> list2 = Arrays.asList("com.mycorp.test2", "com.mycorp.test3");
   AutoConfigurationUtils.storeBasePackages(this.beanFactory, list1);
   AutoConfigurationUtils.storeBasePackages(this.beanFactory, list2);
   List<String> actual = AutoConfigurationUtils.getBasePackages(this.beanFactory);
   assertThat(
       actual, equalTo(Arrays.asList("com.mycorp.test1", "com.mycorp.test2", "com.mycorp.test3")));
 }
コード例 #2
0
 @Test
 public void storeAndGetBasePackages() throws Exception {
   List<String> packageList = Arrays.asList("com.mycorp.test1", "com.mycorp.test2");
   AutoConfigurationUtils.storeBasePackages(this.beanFactory, packageList);
   List<String> actual = AutoConfigurationUtils.getBasePackages(this.beanFactory);
   assertThat(actual, equalTo(packageList));
 }
コード例 #3
0
 @Test
 public void excludedPackages() throws Exception {
   List<String> packageList =
       Arrays.asList("com.mycorp.test1", "org.springframework.data.rest.webmvc");
   AutoConfigurationUtils.storeBasePackages(this.beanFactory, packageList);
   List<String> actual = AutoConfigurationUtils.getBasePackages(this.beanFactory);
   assertThat(actual, equalTo(Arrays.asList("com.mycorp.test1")));
 }