From 89ebafc9a6c92d6df5beb6dcfcf312f85266d038 Mon Sep 17 00:00:00 2001 From: Shubham Aggarwal Date: Wed, 16 Nov 2016 08:29:47 +0530 Subject: [PATCH] Added assertions. --- .../beanfactory/BeanFactoryWithClassPathResource.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spring-core/src/main/java/com/baeldung/beanfactory/BeanFactoryWithClassPathResource.java b/spring-core/src/main/java/com/baeldung/beanfactory/BeanFactoryWithClassPathResource.java index bb9309f394..a3bdbba848 100644 --- a/spring-core/src/main/java/com/baeldung/beanfactory/BeanFactoryWithClassPathResource.java +++ b/spring-core/src/main/java/com/baeldung/beanfactory/BeanFactoryWithClassPathResource.java @@ -11,21 +11,16 @@ import static org.junit.Assert.assertTrue; public class BeanFactoryWithClassPathResource { - Resource res = new ClassPathResource("spring-app.xml"); - BeanFactory factory = new XmlBeanFactory(res); - @Test public void createBeanFactory() { + Resource res = new ClassPathResource("spring-app.xml"); + BeanFactory factory = new XmlBeanFactory(res); Employee emp = (Employee) factory.getBean("employee"); assertFalse(factory.isSingleton("employee")); - assertTrue(factory.getBean("employee") instanceof Employee); - assertTrue(factory.isTypeMatch("employee", Employee.class)); - - //we have empalias as an alias for employee assertTrue(factory.getAliases("employee").length > 0); } }