Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop throwing BindingException in tests #39767

Closed
wants to merge 1 commit into from

Conversation

snicoll
Copy link
Member

@snicoll snicoll commented Feb 27, 2024

This commit adapts the error controller tests that need the request to fail with a bind issue, and simulate the behavior of ModelAttributeMethodProcessor.

As of Spring Framework 6.0.x, this processor no longer throws a BindingException, but rather a MethodArgumentNotValidException and the handing of BindException itself is deprecated.

This makes sure that those tests can smoothly be executed against Spring Framework 6.2.x as throwing a BindingException now results into an unresolved exception, and an internal server error rather than the expected bad request.

This commit adapts the error controller tests that need the request
to fail with a bind issue, and simulate the behavior of
ModelAttributeMethodProcessor.

As of Spring Framework 6.0.x, this processor no longer throws a
BindingException, but rather a MethodArgumentNotValidException and
the handing of BindException itself is deprecated.

This makes sure that those tests can smoothly be executed against
Spring Framework 6.2.x as throwing a BindingException now results
into an unresolved exception, and an internal server error rather than
the expected bad request.
@snicoll snicoll added the status: waiting-for-triage An issue we've not yet triaged label Feb 27, 2024
@scottfrederick scottfrederick added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 27, 2024
@scottfrederick scottfrederick added this to the 3.1.x milestone Feb 27, 2024
scottfrederick pushed a commit that referenced this pull request Feb 27, 2024
This commit adapts the error controller tests that need the request
to fail with a bind issue, and simulate the behavior of
ModelAttributeMethodProcessor.

As of Spring Framework 6.0.x, this processor no longer throws a
BindingException, but rather a MethodArgumentNotValidException and
the handing of BindException itself is deprecated.

This makes sure that those tests can smoothly be executed against
Spring Framework 6.2.x as throwing a BindingException now results
into an unresolved exception, and an internal server error rather than
the expected bad request.

See gh-39767
@scottfrederick scottfrederick modified the milestones: 3.1.x, 3.1.10 Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants