@Test public void loadClass() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class); assertThat(loader.load()).isEqualTo(1); assertThat(this.registry.containsBean("myComponent")).isTrue(); }
@Test public void loadPackage() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getPackage()); assertThat(loader.load()).isEqualTo(1); assertThat(this.registry.containsBean("myComponent")).isTrue(); }
@Test public void loadClassName() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getName()); assertThat(loader.load()).isEqualTo(1); assertThat(this.registry.containsBean("myComponent")).isTrue(); }
@Test public void loadPackageName() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getPackage().getName()); assertThat(loader.load()).isEqualTo(1); assertThat(this.registry.containsBean("myComponent")).isTrue(); }
@Test public void loadPackageAndClassDoesNotDoubleAdd() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getPackage(), MyComponent.class); assertThat(loader.load()).isEqualTo(1); assertThat(this.registry.containsBean("myComponent")).isTrue(); }
@Test public void loadClass() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class); int loaded = loader.load(); assertThat(loaded, equalTo(1)); assertTrue(this.registry.containsBean("myComponent")); }
@Test public void loadPackage() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getPackage()); int loaded = loader.load(); assertThat(loaded, equalTo(1)); assertTrue(this.registry.containsBean("myComponent")); }
@Test public void loadClassName() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getName()); int loaded = loader.load(); assertThat(loaded, equalTo(1)); assertTrue(this.registry.containsBean("myComponent")); }
@Test public void loadPackageName() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getPackage().getName()); int loaded = loader.load(); assertThat(loaded, equalTo(1)); assertTrue(this.registry.containsBean("myComponent")); }
@Test public void loadPackageAndClassDoesNotDoubleAdd() throws Exception { BeanDefinitionLoader loader = new BeanDefinitionLoader(this.registry, MyComponent.class.getPackage(), MyComponent.class); int loaded = loader.load(); assertThat(loaded, equalTo(1)); assertTrue(this.registry.containsBean("myComponent")); }