Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added possibility to read the value basing on jsonpath
fixes #8
- Loading branch information
1 parent
15c7ac1
commit 5584543
Showing
7 changed files
with
145 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
jsonassert/src/main/java/com/toomuchcoding/jsonassert/JsonReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.toomuchcoding.jsonassert; | ||
|
||
/** | ||
* Contract to read the value from a JSON basing on it. | ||
* | ||
* @author Marcin Grzejszczak | ||
* | ||
* @since 0.4.0 | ||
*/ | ||
public interface JsonReader { | ||
|
||
/** | ||
* Returns the value from the JSON, based on the created JSON Path. If the result is an | ||
* JSON Array and has a single value then that value is returned. If that's an array with | ||
* greater number of results then that array is returned. | ||
*/ | ||
<T> T read(Class<T> clazz); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
jsonassert/src/test/groovy/com/toomuchcoding/jsonassert/JsonPathSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package com.toomuchcoding.jsonassert | ||
|
||
import spock.lang.Specification | ||
|
||
/** | ||
* @author Marcin Grzejszczak | ||
*/ | ||
|