Closed
Description
Rob Winch opened SPR-15034 and commented
It would be nice if #16647 could support verifying errors. For example something like this:
@Test(expected = BeanDefinitionParsingException.class)
@ContextConfiguration("classpath:/just-this-method.xml")
public void testBeanDefinitionParsingException() {}
It would also be nice if we could access the entire Exception for verifying the description / caused by, etc.
@Test
@ContextConfiguration("classpath:/just-this-method.xml")
public void testBeanDefinitionParsingException(@ExpectedException BeanDefinitionParsingException expected) {
assertThat(expected).hasDescription("Ooops");
}
Issue Links:
- Support @ContextConfiguration at method level [SPR-12031] #16647 Support
@ContextConfiguration
at method level ("depends on")