Skip to content

SpringJUnit4ClassRunner doesn't catch AssumptionViolatedException in @Before methods [SPR-4570] #9247

@spring-projects-issues

Description

@spring-projects-issues

Noel Flicken opened SPR-4570 and commented

Spring's JUnit4 SpringMethodRoadie doesn't catch a AssumptionViolatedException in #runBefores, differing in functionality from JUnit4's MethodRoadie#runBefores.

The below test class succeeds (via assumption being false) with JUnit4ClassRunner, but fails with SpringJUnit4ClassRunner (due to AssumptionViolatedException being thrown in assumeFalse()).

public static class BeforeMethodTest {
@Before
public void assumeFalse()
{
assumeTrue(false);
}

@Test public void failure()
{
	fail("Before method test");
}

}

Attaching a test case to illustrate.


Attachments:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions