Class BambooJsonUtils


  • public class BambooJsonUtils
    extends Object
    • Method Detail

      • getJsonResource

        @NotNull
        public static @NotNull org.codehaus.jackson.JsonNode getJsonResource​(@NotNull
                                                                             @NotNull String resourceName,
                                                                             @NotNull
                                                                             @NotNull Object object,
                                                                             @NotNull
                                                                             @NotNull Properties subs)
                                                                      throws IOException
        Throws:
        IOException
      • getJsonResource

        @NotNull
        public static @NotNull org.codehaus.jackson.JsonNode getJsonResource​(@NotNull
                                                                             @NotNull String fileName,
                                                                             @NotNull
                                                                             @NotNull Object object)
                                                                      throws IOException
        Throws:
        IOException
      • jsonPathToBoolean

        @NotNull
        public static @NotNull Function<io.restassured.path.json.JsonPath,​Boolean> jsonPathToBoolean​(@NotNull
                                                                                                           @NotNull String path)
      • jsonPathToInteger

        @NotNull
        public static @NotNull Function<io.restassured.path.json.JsonPath,​Integer> jsonPathToInteger​(@NotNull
                                                                                                           @NotNull String path)
      • jsonPathToList

        @NotNull
        public static <T> @NotNull Function<io.restassured.path.json.JsonPath,​List<T>> jsonPathToList​(@NotNull
                                                                                                            @NotNull String path,
                                                                                                            @NotNull
                                                                                                            @NotNull Class<T> clazz)
      • jsonPathToString

        @NotNull
        public static @NotNull Function<io.restassured.path.json.JsonPath,​String> jsonPathToString​(@NotNull
                                                                                                         @NotNull String path)
      • printableJsonPath

        @NotNull
        public static @NotNull io.restassured.path.json.JsonPath printableJsonPath​(@NotNull
                                                                                   @NotNull io.restassured.path.json.JsonPath jsonPath)
        Decorates a JsonPath so that it will print the JSON content on Object.toString() method call.
      • containsAllElementsFrom

        public static org.hamcrest.Matcher<String> containsAllElementsFrom​(String expectedStr,
                                                                           Set<String> exceptions)
        Creates a matcher that checks that all elements from the given json string. exist in the matched node. Note that this does not recurse nodes.
        Parameters:
        expectedStr - The items expected in the real nodes.
        exceptions - Set of strings for attributes that should be ignored when performing the comparison
        Returns:
        a Matcher that checks that all the expected nodes exist.
      • containsAllElementsFrom

        public static org.hamcrest.Matcher<org.codehaus.jackson.JsonNode> containsAllElementsFrom​(org.codehaus.jackson.JsonNode expected,
                                                                                                  Set<String> exceptions)
        Creates a matcher that checks that all elements from the given JsonNode exist in the matched node. Note that this recurses nodes in objects to check for equality. Arrays must be exact and in-order.
        Parameters:
        expected - The items expected in the real nodes.
        exceptions - Set of strings for attributes that should be ignored when performing the comparison
        Returns:
        a Matcher that checks that all the expected nodes exist.
      • containsAllElementsFrom

        public static org.hamcrest.Matcher<String> containsAllElementsFrom​(String expectedStr)
      • containsAllElementsFrom

        public static org.hamcrest.Matcher<org.codehaus.jackson.JsonNode> containsAllElementsFrom​(org.codehaus.jackson.JsonNode jsonNode)