How to check value on a Postgres JsonB field?
@VanRoy is already working on this.
Since Oct 1, 2020.
Assessment
This issue has not been assessed yet.
Description
I trying to check the values inserted on a table where a field is of the type jsonb.
When I run something like this:
assertThat(eventsTable)
.row(0)
.value("data").isEqualTo("{\"key\": \"value\"}");
I get the following error:
[Value at index 0 (column name : DATA) of Row at index 0 of events table]
Expecting:
<{"key": "value"}>
to be of type
<[TEXT, NUMBER, DATE, TIME, DATE_TIME, UUID]>
but was of type
<NOT_IDENTIFIED> (org.postgresql.util.PGobject)
Here is the table content:
[events table]
|-----------|---------|-------------------------------------------------------|
| | | |
| | PRIMARY | DATA |
| | KEY | (NOT_IDENTIFIED : class org.postgresql.util.PGobject) |
| | | Index : 0 |
|-----------|---------|-------------------------------------------------------|
| Index : 0 | | {"key": "value"} |
|-----------|---------|-------------------------------------------------------|
Using assertj-db 2.0.0
Is there any way I can check the content of a PostgreSQL jsonb column?
- Dominant language
- Java
- Stars
- 130
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from assertj/assertj-db
-
assertj/assertj-db#324 · 1 comment · 1 assignee ·
-
question
Difficulty 3/5 1-2 days Newbie friendliness 32/100
assertj/assertj-db#292 · 1 comment ·
-
question
Difficulty 3/5 1-2 days Newbie friendliness 35/100
assertj/assertj-db#290 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
assertj/assertj-db#259 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
assertj/assertj-db#206 ·
All issues in assertj/assertj-db
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cryptomator/hub#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
johanhaleby/occurrent#1120 ·