update BeanFactoryUtilsTest

pull/515/head
DerekYRC 3 years ago
parent 3641bef931
commit 889e0d790a

@ -19,12 +19,18 @@ public class BeanFactoryUtilsTest {
parentBeanFactory.registerBeanDefinition("foo", new RootBeanDefinition(Foo.class)); parentBeanFactory.registerBeanDefinition("foo", new RootBeanDefinition(Foo.class));
DefaultListableBeanFactory childBeanFactory = new DefaultListableBeanFactory(parentBeanFactory); DefaultListableBeanFactory childBeanFactory = new DefaultListableBeanFactory(parentBeanFactory);
Assert.assertTrue(childBeanFactory.getBeansOfType(Foo.class).isEmpty());
Assert.assertTrue(childBeanFactory.getBeansOfType(Foo.class).isEmpty());
Assert.assertTrue(BeanFactoryUtils.getBeans(childBeanFactory, Foo.class).size() == 1); Assert.assertTrue(BeanFactoryUtils.getBeans(childBeanFactory, Foo.class).size() == 1);
Assert.assertTrue(BeanFactoryUtils.getBeans(childBeanFactory, Bar.class).isEmpty());
} }
static class Foo { static class Foo {
} }
static class Bar {
}
} }

Loading…
Cancel
Save