提交 0b63db26 编写于 作者: S Sam Brannen

Reinstate AbstractBeanFactoryTests.typeMismatch() test

上级 a07ce8eb
......@@ -22,7 +22,7 @@ import java.util.StringTokenizer;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyBatchUpdateException;
import org.springframework.beans.TypeMismatchException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanIsNotAFactoryException;
......@@ -191,17 +191,11 @@ public abstract class AbstractBeanFactoryTests {
assertThat(ve.getName() == null && ve.getAge() == 0 && ve.getSpouse() == null).as("Valid empty has defaults").isTrue();
}
public void xtestTypeMismatch() {
assertThatExceptionOfType(BeanCreationException.class).isThrownBy(() ->
getBeanFactory().getBean("typeMismatch"))
.withCauseInstanceOf(PropertyBatchUpdateException.class)
.satisfies(ex -> {
assertThat(ex.getBeanName()).isEqualTo("typeMismatch");
PropertyBatchUpdateException pex = (PropertyBatchUpdateException) ex.getCause();
assertThat(pex.getExceptionCount()).isEqualTo(1);
assertThat(pex.getPropertyAccessException("age")).isNotNull();
assertThat(pex.getPropertyAccessException("age").getPropertyChangeEvent().getNewValue()).isEqualTo("34x");
});
@Test
public void typeMismatch() {
assertThatExceptionOfType(BeanCreationException.class)
.isThrownBy(() -> getBeanFactory().getBean("typeMismatch"))
.withCauseInstanceOf(TypeMismatchException.class);
}
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册