public class BambooJsonUtils extends Object
Modifier and Type | Method and Description |
---|---|
static org.hamcrest.Matcher<com.fasterxml.jackson.databind.JsonNode> |
containsAllElementsFrom(com.fasterxml.jackson.databind.JsonNode jsonNode) |
static org.hamcrest.Matcher<com.fasterxml.jackson.databind.JsonNode> |
containsAllElementsFrom(com.fasterxml.jackson.databind.JsonNode expected,
Set<String> exceptions)
Creates a matcher that checks that all elements from the given JsonNode
exist in the matched node.
|
static org.hamcrest.Matcher<String> |
containsAllElementsFrom(String expectedStr) |
static org.hamcrest.Matcher<String> |
containsAllElementsFrom(String expectedStr,
Set<String> exceptions)
Creates a matcher that checks that all elements from the given json string.
|
static com.fasterxml.jackson.databind.JsonNode |
getJsonResource(String fileName,
Object object) |
static com.fasterxml.jackson.databind.JsonNode |
getJsonResource(String resourceName,
Object object,
Properties subs) |
static Function<io.restassured.path.json.JsonPath,Boolean> |
jsonPathToBoolean(String path) |
static Function<io.restassured.path.json.JsonPath,Integer> |
jsonPathToInteger(String path) |
static <T> Function<io.restassured.path.json.JsonPath,List<T>> |
jsonPathToList(String path,
Class<T> clazz) |
static Function<io.restassured.path.json.JsonPath,String> |
jsonPathToString(String path) |
static io.restassured.path.json.JsonPath |
printableJsonPath(io.restassured.path.json.JsonPath jsonPath)
Decorates a
JsonPath so that it will print the JSON content on Object.toString() method call. |
@NotNull public static com.fasterxml.jackson.databind.JsonNode getJsonResource(@NotNull String resourceName, @NotNull Object object, @NotNull Properties subs) throws IOException
IOException
@NotNull public static com.fasterxml.jackson.databind.JsonNode getJsonResource(@NotNull String fileName, @NotNull Object object) throws IOException
IOException
@NotNull public static Function<io.restassured.path.json.JsonPath,Boolean> jsonPathToBoolean(@NotNull String path)
@NotNull public static Function<io.restassured.path.json.JsonPath,Integer> jsonPathToInteger(@NotNull String path)
@NotNull public static <T> Function<io.restassured.path.json.JsonPath,List<T>> jsonPathToList(@NotNull String path, @NotNull Class<T> clazz)
@NotNull public static Function<io.restassured.path.json.JsonPath,String> jsonPathToString(@NotNull String path)
@NotNull public static io.restassured.path.json.JsonPath printableJsonPath(@NotNull io.restassured.path.json.JsonPath jsonPath)
JsonPath
so that it will print the JSON content on Object.toString()
method call.public static org.hamcrest.Matcher<String> containsAllElementsFrom(String expectedStr, Set<String> exceptions)
expectedStr
- The items expected in the real nodes.exceptions
- Set of strings for attributes that should be ignored when performing the comparisonpublic static org.hamcrest.Matcher<com.fasterxml.jackson.databind.JsonNode> containsAllElementsFrom(com.fasterxml.jackson.databind.JsonNode expected, Set<String> exceptions)
expected
- The items expected in the real nodes.exceptions
- Set of strings for attributes that should be ignored when performing the comparisonpublic static org.hamcrest.Matcher<String> containsAllElementsFrom(String expectedStr)
public static org.hamcrest.Matcher<com.fasterxml.jackson.databind.JsonNode> containsAllElementsFrom(com.fasterxml.jackson.databind.JsonNode jsonNode)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.