update BeanFactoryUtilsTest

pull/517/head
DerekYRC 3 years ago
parent 9a1bbd732e
commit f690252c29

@ -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