Skip to content

Commit

Permalink
README updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan-lt committed Mar 24, 2020
1 parent b850ed3 commit 8d30c50
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,26 @@ assertThatJson("{\"root\":[\"true\"]}").node("root").isArray().containsExactly(v
It's recommended to use `JsonAssertions.json()` if you want to parse expected value as JSON and
`JsonAssertions.value()` if you want to use the value as is.

Following Kotlin API is supported (notice different import)

```kotlin
import net.javacrumbs.jsonunit.assertj.assertThatJson

assertThatJson("""{"root":{"a":1, "b": 2}}""") {
isObject
node("root.a").isEqualTo(1)
node("root.b").isEqualTo(2)
}
```


To use AssertJ integration, import

```xml
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-assertj</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
<scope>test</scope>
</dependency>
```
Expand Down Expand Up @@ -133,7 +145,7 @@ To use import
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
<scope>test</scope>
</dependency>
```
Expand Down Expand Up @@ -161,7 +173,7 @@ this.mockMvc.perform(get("/sample").andExpect(
);
```

Since 2.15.0 following Kotlin DSL si supported:
Following Kotlin DSL si supported:

```kotlin
mockMvc.get(path).andExpect {
Expand All @@ -178,7 +190,7 @@ To use import
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-spring</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
<scope>test</scope>
</dependency>
```
Expand All @@ -200,7 +212,7 @@ To use import
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-spring</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
<scope>test</scope>
</dependency>
```
Expand Down Expand Up @@ -235,7 +247,7 @@ For other API styles you have to first import JsonPath support module
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-json-path</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
<scope>test</scope>
</dependency>
```
Expand Down Expand Up @@ -575,6 +587,9 @@ JsonUnit is licensed under [Apache 2.0 licence](https://www.apache.org/licenses/
Release notes
=============
## 2.16.0
* Kotlin DSL for AssertJ API
## 2.15.0
* Spring DSL Koltin support
* JUnit upgraded to 5.6.0
Expand Down

0 comments on commit 8d30c50

Please sign in to comment.