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

Introduce soft assertions for MockMvc #26917

Closed

Conversation

wyhasany
Copy link
Contributor

@wyhasany wyhasany commented May 9, 2021

It happens very often that MockMvc is used in
heavyweight integration tests. It's no use to waste
time to check if another condition has been fixed or
not. Soft assertion could help a lot to check all
conditions at once even if one of them fail.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 9, 2021
@wyhasany wyhasany force-pushed the feature/assert-softly branch 2 times, most recently from 4362294 to 2df94a6 Compare May 10, 2021 08:05
@sbrannen sbrannen changed the title Soft assertions for MockMvc Introduce soft assertions for MockMvc May 10, 2021
@sbrannen sbrannen added for: backport-to-4.3.x in: web Issues in web modules (web, webmvc, webflux, websocket) labels May 10, 2021
@sbrannen sbrannen added the in: test Issues in the test module label May 10, 2021
@sbrannen
Copy link
Member

sbrannen commented May 10, 2021

@sbrannen sbrannen added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 10, 2021
@sbrannen sbrannen added this to the 5.3.8 milestone May 10, 2021
@sbrannen sbrannen self-assigned this May 10, 2021
@wyhasany
Copy link
Contributor Author

@nguyensach I've applied your suggestions. Do you need any action on my side?

Copy link
Contributor

@nguyensach nguyensach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Co-authored-by: Sach Nguyen <sachnbbkhn@gmail.com>

It happens very often that MockMvc is used in
heavyweight integration tests. It's no use to waste
time to check if another condition has been fixed or
not. Soft assertion could help a lot to check all
conditions at once even if one of them fail.
@sbrannen sbrannen modified the milestones: 5.3.8, 5.3.9 Jun 7, 2021
@sbrannen sbrannen modified the milestones: 5.3.9, 5.3.10 Jul 5, 2021
sbrannen pushed a commit to sbrannen/spring-framework that referenced this pull request Aug 22, 2021
It happens very often that MockMvc is used in heavyweight integration
tests. It's no use to waste time to check if another condition has been
fixed or not. Soft assertions help a lot by checking all conditions at
once even if one of them fails.

See spring-projectsgh-26917

Co-authored-by: Sach Nguyen <sachnbbkhn@gmail.com>
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 22, 2021
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 22, 2021
@sbrannen
Copy link
Member

Current work on this issue can be seen in the following feature branch: main...sbrannen:issues/gh-26917-MockMvc-soft-assertions

sbrannen pushed a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
It happens very often that MockMvc is used in heavyweight integration
tests. It's no use to waste time to check if another condition has been
fixed or not. Soft assertions help a lot by checking all conditions at
once even if one of them fails.

See spring-projectsgh-26917

Co-authored-by: Sach Nguyen <sachnbbkhn@gmail.com>
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
sbrannen pushed a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
It happens very often that MockMvc is used in heavyweight integration
tests. It's no use to waste time to check if another condition has been
fixed or not. Soft assertions help a lot by checking all conditions at
once even if one of them fails.

See spring-projectsgh-26917

Co-authored-by: Sach Nguyen <sachnbbkhn@gmail.com>
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Aug 23, 2021
@sbrannen sbrannen closed this in dd9b99e Aug 23, 2021
@sbrannen
Copy link
Member

Thanks for the PR, @wyhasany! 👍

This has been merged into main in 35bec81, refined in 5f47d3b and cd078ea, and then fully revised in dd9b99e.

In the end we decided to introduce a new andExpectAll() method in ResultActions and to move away from static methods in ResultMatcher. In fact, we even deprecated the existing matchAll() method in ResultMatcher.

lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this pull request Mar 26, 2022
It happens very often that MockMvc is used in heavyweight integration
tests. It's no use to waste time to check if another condition has been
fixed or not. Soft assertions help a lot by checking all conditions at
once even if one of them fails.

See spring-projectsgh-26917

Co-authored-by: Sach Nguyen <sachnbbkhn@gmail.com>
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this pull request Mar 26, 2022
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this pull request Mar 26, 2022
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this pull request Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants