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

How to do soft assertions with assertj APIs? #482

Open
akshayamaldhure opened this issue Mar 7, 2022 · 1 comment
Open

How to do soft assertions with assertj APIs? #482

akshayamaldhure opened this issue Mar 7, 2022 · 1 comment

Comments

@akshayamaldhure
Copy link

akshayamaldhure commented Mar 7, 2022

My test case has a flow that looks like this:

  1. Create some config.
  2. Hit an API and perform JSON assertion using https://github.com/lukas-krecan/JsonUnit#assertj-integration.
  3. Hit the same API with different parameters and perform similar JSON assertions.

The problem is that if the assertion at step 2 fails, then step 3 is not performed at all, which is like a hard assertion. So I'm wondering if there's a way to make the flow go through and do each and every assertion (soft assertion).

EDIT: I see that the core AssertJ library supports soft assertions (https://assertj.github.io/doc/#assertj-core-soft-assertions). I'm not sure how to use the json unit assertions with the same though.

@lukas-krecan
Copy link
Owner

Duplicate of #145

@lukas-krecan lukas-krecan marked this as a duplicate of #145 Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants