Skip to content

Support Verifying Errors with @ContextConfiguration at method level [SPR-15034] #19600

Closed

Description

@spring-projects-issues

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:

Activity

  1. spring-projects-issues commented on Dec 19, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Sam Brannen commented

    Interesting ideas. Thanks for creating the ticket.

  2. spring-projects-issues commented on Dec 19, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Rob Winch commented

    Thanks for the quick reply!

    Please note (I probably should have put this in the description, but it is probably implied) I am not particular on how it is done, just so that I can verify Exceptions, descriptions, caused bys, etc

  3. added
    status: waiting-for-triage
    in: test
    type: enhancement
    and removed
    type: enhancement
    on Jan 11, 2019
  4. added
    status: bulk-closed
    and removed
    status: waiting-for-triage
    status: ideal-for-contribution
    on Jan 11, 2019
  5. spring-projects-issues commented on Jan 11, 2019

    @spring-projects-issues
    CollaboratorAuthor

    Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: teststatus: bulk-closed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions