Skip to content

SpringJUnit4ClassRunner is not compatible with java context configuration [SPR-7769] #12425

Closed
@spring-projects-issues

Description

@spring-projects-issues

Stepan Koltsov opened SPR-7769 and commented

have test:

@RunWith(SpringJUnit4ClassRunner.class)
@Import(SomeTestContext.class)
public class SomeTest {
 ....
}

get exception:

Caused by: java.lang.IllegalArgumentException: Can not load an ApplicationContext with a NULL 'contextLoader'. Consider annotating your test class with @ContextConfiguration.
	at org.springframework.util.Assert.notNull(Assert.java:112)
	at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:276)
	at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
	... 24 more

Affects: 3.0.2

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: dataIssues in data modules (jdbc, orm, oxm, tx)status: duplicateA duplicate of another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions