Skip to content

ServletTestExecutionListener breaks old code [SPR-11144] #15771

@spring-projects-issues

Description

@spring-projects-issues

Aleksandr Dubinsky opened SPR-11144 and commented

The Javadoc for ServletTestExecutionListener says:

Note that ServletTestExecutionListener is enabled by default but takes no action if the ApplicationContext loaded for the current test is not a WebApplicationContext.

However, this is not true. The afterTestMethod() method calls RequestContextHolder.resetRequestAttributes() without checking for the presence of a WebApplicationContext. This breaks old test code simply by upgrading to Spring 3.2, and it is difficult for a user to ascertain why.


Issue Links:

Backported to: 3.2.6

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions