Skip to content

Commit 72fa3f6

Browse files
committed
Add simplified JSON example to README
1 parent f05d7de commit 72fa3f6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from the releases tab.
2323
<dependency>
2424
<groupId>net.joshka</groupId>
2525
<artifactId>junit-json-params</artifactId>
26-
<version>1.0.0</version>
26+
<version>1.1.0</version>
2727
</dependency>
2828
```
2929

@@ -82,6 +82,18 @@ void arrayOfNumbers(JsonNumber number) {
8282
void arrayOfStrings(JsonString string) {
8383
assertThat(string.getString()).startsWith("value");
8484
}
85+
86+
/**
87+
* When passed <code>{'key':'value'}</code>, is executed a single time.
88+
* This simplifies writing inline JSON strings
89+
* @param object the parsed JsonObject
90+
*/
91+
@ParameterizedTest
92+
@JsonSource("{'key':'value'}")
93+
@DisplayName("handles simplified json")
94+
void simplifiedJson(JsonObject object) {
95+
assertThat(object.getString("key")).isEqualTo("value");
96+
}
8597
```
8698

8799
### `@JsonFileSource`

0 commit comments

Comments
 (0)