Skip to content

Slice test includes fail to load when using spring-boot-starter-test-classic #48981

@christophejan

Description

@christophejan

I think class presence should be checked on autoconfigure includes.

With Spring Boot 4.0.2, using WebMvcTest with just spring-boot-starter-webmvc and spring-boot-starter-test-classic as dependencies result in :

java.lang.IllegalArgumentException: Failed to load include 'org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer' declared in jar:file:[...]/spring-boot-security-test-4.0.2.jar!/META-INF/spring/org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest.includes[...]

Here a sample application that reproduces the problem.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions