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

Better assertion failures for containJsonKeyValue #3949

Merged
merged 2 commits into from May 9, 2024

Conversation

Kantis
Copy link
Member

@Kantis Kantis commented Mar 21, 2024

Now prints whether the key was missing, or if it had wrong value

Now prints whether the key was missing, or if it had wrong value
shouldFail {
json.shouldContainJsonKeyValue("$.bicycle.engine", "V2")
}.message shouldBe """
Expected given to contain json key <'$.bicycle.engine'> but key was not found.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to print partial matches, such as:

Expected given to contain json key <'$.store.book.weight'> but key was not found. 
Found the following sub-key: <'$.store.book'>.

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose it would, but I don't believe we get that information out of the JsonPath library. How do you intend that we should calculate that subkey?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think perhaps we can merge this small improvement as-is, and we could make further improvements in a separate PR :) We can continue the discussion here even after PR is merged

@Kantis Kantis marked this pull request as ready for review May 9, 2024 09:29
@Kantis Kantis enabled auto-merge May 9, 2024 09:29
@Kantis Kantis disabled auto-merge May 9, 2024 10:23
@Kantis Kantis merged commit de54d17 into master May 9, 2024
15 checks passed
@Kantis Kantis deleted the kantis/improve-contain-json-key-value branch May 9, 2024 10:24
renovate bot added a commit to StefanLobbenmeier/yt-dlp-compose that referenced this pull request May 9, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [io.kotest:kotest-runner-junit5](https://togithub.com/kotest/kotest) |
`5.8.1` -> `5.9.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.kotest:kotest-runner-junit5/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.kotest:kotest-runner-junit5/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.kotest:kotest-runner-junit5/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.kotest:kotest-runner-junit5/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>kotest/kotest (io.kotest:kotest-runner-junit5)</summary>

### [`v5.9.0`](https://togithub.com/kotest/kotest/releases/tag/v5.9.0)

#### Highlights

Support for wasmJs has been added, curtesy of
[@&#8203;OliverO2](https://togithub.com/OliverO2)

#### What's Changed

- Add wasmJs target by [@&#8203;OliverO2](https://togithub.com/OliverO2)
in
[kotest/kotest#3805
- fix(docs): indentation in System Extensions by
[@&#8203;craigpastro](https://togithub.com/craigpastro) in
[kotest/kotest#3940
- Change Arb.filterIsInstance() signature to use single type parameter
by [@&#8203;kshired](https://togithub.com/kshired) in
[kotest/kotest#3943
- Add missing functions to property-arbs docs by
[@&#8203;snowe2010](https://togithub.com/snowe2010) in
[kotest/kotest#3945
- Increasing JVM heap allowance on GitHub by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#3948
- Fix JS and Wasm/JS test timeouts, bring back Node.js test output by
[@&#8203;OliverO2](https://togithub.com/OliverO2) in
[kotest/kotest#3953
- add-similarity-to-contains-draft
([#&#8203;42](https://togithub.com/kotest/kotest/issues/42)) by
[@&#8203;AlexCue987](https://togithub.com/AlexCue987) in
[kotest/kotest#3906
- Update Sonatype snapshot URL by
[@&#8203;aSemy](https://togithub.com/aSemy) in
[kotest/kotest#3956
- Fix json assertions artifact coordinate in docs by
[@&#8203;TWiStErRob](https://togithub.com/TWiStErRob) in
[kotest/kotest#3968
- Create CODE_OF_CONDUCT.md by
[@&#8203;sschuberth](https://togithub.com/sschuberth) in
[kotest/kotest#3987
- Restructure Kotlin/JS and Kotlin/JS/Wasm testing, fix
[#&#8203;3329](https://togithub.com/kotest/kotest/issues/3329) by
[@&#8203;OliverO2](https://togithub.com/OliverO2) in
[kotest/kotest#3954
- Correct Collection Matchers Documentation For
`collection.shouldContainAllInAnyOrder()` by
[@&#8203;u-ways-e](https://togithub.com/u-ways-e) in
[kotest/kotest#3995
- chore(deps): update plugin com.gradle.enterprise to v3.17.2 by
[@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3990
- Add kotlin-faker to extensions list by
[@&#8203;serpro69](https://togithub.com/serpro69) in
[kotest/kotest#3971
- Better assertion failures for containJsonKeyValue by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#3949
- fix(deps): update dependency io.github.classgraph:classgraph to
v4.8.172 by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3957
- Add similarity to contain exactly in any order by
[@&#8203;AlexCue987](https://togithub.com/AlexCue987) in
[kotest/kotest#3938
- Fix Arb.list failing within edge cases in case of null values by
[@&#8203;oliverblaha](https://togithub.com/oliverblaha) in
[kotest/kotest#3982
- chore(deps): update plugin kotlinbinarycompatibilityvalidator to
v0.14.0 by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3993
- chore(deps): update plugin io.kotest.multiplatform to v5.8.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3992
- fixing the kotest autoscan warning message to reference the right
property name by [@&#8203;stepanv](https://togithub.com/stepanv) in
[kotest/kotest#4000
- fix(deps): update dependency io.projectreactor.tools:blockhound to
v1.0.9.release by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3989
- Allow comparison between empty set and other iterables by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#4005
- Moving similarity feature to kotest-assertions-core by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#4006

#### New Contributors

- [@&#8203;craigpastro](https://togithub.com/craigpastro) made their
first contribution in
[kotest/kotest#3940
- [@&#8203;snowe2010](https://togithub.com/snowe2010) made their first
contribution in
[kotest/kotest#3945
- [@&#8203;TWiStErRob](https://togithub.com/TWiStErRob) made their first
contribution in
[kotest/kotest#3968
- [@&#8203;u-ways-e](https://togithub.com/u-ways-e) made their first
contribution in
[kotest/kotest#3995
- [@&#8203;serpro69](https://togithub.com/serpro69) made their first
contribution in
[kotest/kotest#3971
- [@&#8203;stepanv](https://togithub.com/stepanv) made their first
contribution in
[kotest/kotest#4000

**Full Changelog**:
kotest/kotest@v5.8.1...v5.9.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/StefanLobbenmeier/yt-dlp-compose).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot added a commit to typesafegithub/github-actions-typing that referenced this pull request May 9, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [io.kotest:kotest-bom](https://togithub.com/kotest/kotest) | `5.8.1`
-> `5.9.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.kotest:kotest-bom/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.kotest:kotest-bom/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.kotest:kotest-bom/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.kotest:kotest-bom/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>kotest/kotest (io.kotest:kotest-bom)</summary>

### [`v5.9.0`](https://togithub.com/kotest/kotest/releases/tag/v5.9.0)

#### Highlights

Support for wasmJs has been added, curtesy of
[@&#8203;OliverO2](https://togithub.com/OliverO2)

#### What's Changed

- Add wasmJs target by [@&#8203;OliverO2](https://togithub.com/OliverO2)
in
[kotest/kotest#3805
- fix(docs): indentation in System Extensions by
[@&#8203;craigpastro](https://togithub.com/craigpastro) in
[kotest/kotest#3940
- Change Arb.filterIsInstance() signature to use single type parameter
by [@&#8203;kshired](https://togithub.com/kshired) in
[kotest/kotest#3943
- Add missing functions to property-arbs docs by
[@&#8203;snowe2010](https://togithub.com/snowe2010) in
[kotest/kotest#3945
- Increasing JVM heap allowance on GitHub by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#3948
- Fix JS and Wasm/JS test timeouts, bring back Node.js test output by
[@&#8203;OliverO2](https://togithub.com/OliverO2) in
[kotest/kotest#3953
- add-similarity-to-contains-draft
([#&#8203;42](https://togithub.com/kotest/kotest/issues/42)) by
[@&#8203;AlexCue987](https://togithub.com/AlexCue987) in
[kotest/kotest#3906
- Update Sonatype snapshot URL by
[@&#8203;aSemy](https://togithub.com/aSemy) in
[kotest/kotest#3956
- Fix json assertions artifact coordinate in docs by
[@&#8203;TWiStErRob](https://togithub.com/TWiStErRob) in
[kotest/kotest#3968
- Create CODE_OF_CONDUCT.md by
[@&#8203;sschuberth](https://togithub.com/sschuberth) in
[kotest/kotest#3987
- Restructure Kotlin/JS and Kotlin/JS/Wasm testing, fix
[#&#8203;3329](https://togithub.com/kotest/kotest/issues/3329) by
[@&#8203;OliverO2](https://togithub.com/OliverO2) in
[kotest/kotest#3954
- Correct Collection Matchers Documentation For
`collection.shouldContainAllInAnyOrder()` by
[@&#8203;u-ways-e](https://togithub.com/u-ways-e) in
[kotest/kotest#3995
- chore(deps): update plugin com.gradle.enterprise to v3.17.2 by
[@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3990
- Add kotlin-faker to extensions list by
[@&#8203;serpro69](https://togithub.com/serpro69) in
[kotest/kotest#3971
- Better assertion failures for containJsonKeyValue by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#3949
- fix(deps): update dependency io.github.classgraph:classgraph to
v4.8.172 by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3957
- Add similarity to contain exactly in any order by
[@&#8203;AlexCue987](https://togithub.com/AlexCue987) in
[kotest/kotest#3938
- Fix Arb.list failing within edge cases in case of null values by
[@&#8203;oliverblaha](https://togithub.com/oliverblaha) in
[kotest/kotest#3982
- chore(deps): update plugin kotlinbinarycompatibilityvalidator to
v0.14.0 by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3993
- chore(deps): update plugin io.kotest.multiplatform to v5.8.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3992
- fixing the kotest autoscan warning message to reference the right
property name by [@&#8203;stepanv](https://togithub.com/stepanv) in
[kotest/kotest#4000
- fix(deps): update dependency io.projectreactor.tools:blockhound to
v1.0.9.release by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3989
- Allow comparison between empty set and other iterables by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#4005
- Moving similarity feature to kotest-assertions-core by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#4006

#### New Contributors

- [@&#8203;craigpastro](https://togithub.com/craigpastro) made their
first contribution in
[kotest/kotest#3940
- [@&#8203;snowe2010](https://togithub.com/snowe2010) made their first
contribution in
[kotest/kotest#3945
- [@&#8203;TWiStErRob](https://togithub.com/TWiStErRob) made their first
contribution in
[kotest/kotest#3968
- [@&#8203;u-ways-e](https://togithub.com/u-ways-e) made their first
contribution in
[kotest/kotest#3995
- [@&#8203;serpro69](https://togithub.com/serpro69) made their first
contribution in
[kotest/kotest#3971
- [@&#8203;stepanv](https://togithub.com/stepanv) made their first
contribution in
[kotest/kotest#4000

**Full Changelog**:
kotest/kotest@v5.8.1...v5.9.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/typesafegithub/github-actions-typing).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot added a commit to TeamDev-IP/JxBrowser-Gradle-Plugin that referenced this pull request May 10, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [io.kotest:kotest-assertions-core](https://togithub.com/kotest/kotest)
| `5.8.1` -> `5.9.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.kotest:kotest-assertions-core/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.kotest:kotest-assertions-core/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.kotest:kotest-assertions-core/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.kotest:kotest-assertions-core/5.8.1/5.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>kotest/kotest (io.kotest:kotest-assertions-core)</summary>

### [`v5.9.0`](https://togithub.com/kotest/kotest/releases/tag/v5.9.0)

#### Highlights

Support for wasmJs has been added, curtesy of
[@&#8203;OliverO2](https://togithub.com/OliverO2)

#### What's Changed

- Add wasmJs target by [@&#8203;OliverO2](https://togithub.com/OliverO2)
in
[kotest/kotest#3805
- fix(docs): indentation in System Extensions by
[@&#8203;craigpastro](https://togithub.com/craigpastro) in
[kotest/kotest#3940
- Change Arb.filterIsInstance() signature to use single type parameter
by [@&#8203;kshired](https://togithub.com/kshired) in
[kotest/kotest#3943
- Add missing functions to property-arbs docs by
[@&#8203;snowe2010](https://togithub.com/snowe2010) in
[kotest/kotest#3945
- Increasing JVM heap allowance on GitHub by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#3948
- Fix JS and Wasm/JS test timeouts, bring back Node.js test output by
[@&#8203;OliverO2](https://togithub.com/OliverO2) in
[kotest/kotest#3953
- add-similarity-to-contains-draft
([#&#8203;42](https://togithub.com/kotest/kotest/issues/42)) by
[@&#8203;AlexCue987](https://togithub.com/AlexCue987) in
[kotest/kotest#3906
- Update Sonatype snapshot URL by
[@&#8203;aSemy](https://togithub.com/aSemy) in
[kotest/kotest#3956
- Fix json assertions artifact coordinate in docs by
[@&#8203;TWiStErRob](https://togithub.com/TWiStErRob) in
[kotest/kotest#3968
- Create CODE_OF_CONDUCT.md by
[@&#8203;sschuberth](https://togithub.com/sschuberth) in
[kotest/kotest#3987
- Restructure Kotlin/JS and Kotlin/JS/Wasm testing, fix
[#&#8203;3329](https://togithub.com/kotest/kotest/issues/3329) by
[@&#8203;OliverO2](https://togithub.com/OliverO2) in
[kotest/kotest#3954
- Correct Collection Matchers Documentation For
`collection.shouldContainAllInAnyOrder()` by
[@&#8203;u-ways-e](https://togithub.com/u-ways-e) in
[kotest/kotest#3995
- chore(deps): update plugin com.gradle.enterprise to v3.17.2 by
[@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3990
- Add kotlin-faker to extensions list by
[@&#8203;serpro69](https://togithub.com/serpro69) in
[kotest/kotest#3971
- Better assertion failures for containJsonKeyValue by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#3949
- fix(deps): update dependency io.github.classgraph:classgraph to
v4.8.172 by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3957
- Add similarity to contain exactly in any order by
[@&#8203;AlexCue987](https://togithub.com/AlexCue987) in
[kotest/kotest#3938
- Fix Arb.list failing within edge cases in case of null values by
[@&#8203;oliverblaha](https://togithub.com/oliverblaha) in
[kotest/kotest#3982
- chore(deps): update plugin kotlinbinarycompatibilityvalidator to
v0.14.0 by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3993
- chore(deps): update plugin io.kotest.multiplatform to v5.8.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3992
- fixing the kotest autoscan warning message to reference the right
property name by [@&#8203;stepanv](https://togithub.com/stepanv) in
[kotest/kotest#4000
- fix(deps): update dependency io.projectreactor.tools:blockhound to
v1.0.9.release by [@&#8203;renovate](https://togithub.com/renovate) in
[kotest/kotest#3989
- Allow comparison between empty set and other iterables by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#4005
- Moving similarity feature to kotest-assertions-core by
[@&#8203;Kantis](https://togithub.com/Kantis) in
[kotest/kotest#4006

#### New Contributors

- [@&#8203;craigpastro](https://togithub.com/craigpastro) made their
first contribution in
[kotest/kotest#3940
- [@&#8203;snowe2010](https://togithub.com/snowe2010) made their first
contribution in
[kotest/kotest#3945
- [@&#8203;TWiStErRob](https://togithub.com/TWiStErRob) made their first
contribution in
[kotest/kotest#3968
- [@&#8203;u-ways-e](https://togithub.com/u-ways-e) made their first
contribution in
[kotest/kotest#3995
- [@&#8203;serpro69](https://togithub.com/serpro69) made their first
contribution in
[kotest/kotest#3971
- [@&#8203;stepanv](https://togithub.com/stepanv) made their first
contribution in
[kotest/kotest#4000

**Full Changelog**:
kotest/kotest@v5.8.1...v5.9.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/TeamDev-IP/JxBrowser-Gradle-Plugin).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants