change expect exception in ut

This commit is contained in:
DianeDuan 2016-11-21 21:51:20 +08:00
parent 77240dc024
commit e84957c768

View File

@ -1,15 +1,16 @@
package com.baeldung.factorybean; package com.baeldung.factorybean;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
public class FactoryBeanInitializeTest { public class FactoryBeanInitializeTest {
@Test(expected = Exception.class) @Test(expected = BeanCreationException.class)
public void testInitializationToolFactory() { public void testInitializationToolFactory() {
new ClassPathXmlApplicationContext("classpath:factorybean-init-spring-ctx.xml"); new ClassPathXmlApplicationContext("classpath:factorybean-init-spring-ctx.xml");
} }
@Test(expected = Exception.class) @Test(expected = BeanCreationException.class)
public void testPostConstructToolFactory() { public void testPostConstructToolFactory() {
new ClassPathXmlApplicationContext("classpath:factorybean-postconstruct-spring-ctx.xml"); new ClassPathXmlApplicationContext("classpath:factorybean-postconstruct-spring-ctx.xml");
} }