Skip to content

Deprecate 'secure' on WebMvcTest and AutoConfigureMockMvc #14227

@mbhave

Description

@mbhave

The secure flag dictates if Spring Security's mock mvc support should be auto-configured when it is
on the classpath. It also imports SecurityAutoConfiguration if set to true. However, Spring Security provides some handy test support which means you do not need to disable security for tests in most cases. For example, you can add @WithMockuser and the test will run with an authenticated user.

This will also cause this bug to go away.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions