public class JSONTestUtil extends Object
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DELTA
Default delta used in numeric equality comparisons for floats and doubles.
|
static boolean |
failRepeatedKeys |
Constructor and Description |
---|
JSONTestUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
match(String input,
String pathAndExpected)
comparison using default delta
|
static String |
match(String input,
String pathAndExpected,
double delta) |
static String |
match(String path,
String input,
String expected)
comparison using default delta
|
static String |
match(String path,
String input,
String expected,
double delta) |
static String |
matchObj(Object input,
String pathAndExpected,
double delta) |
static String |
matchObj(String path,
Object input,
Object expected)
comparison using default delta
|
static String |
matchObj(String path,
Object input,
Object expected,
double delta) |
public static final double DEFAULT_DELTA
public static boolean failRepeatedKeys
public static String match(String input, String pathAndExpected) throws Exception
Exception
DEFAULT_DELTA
,
match(String,String,double)
public static String match(String path, String input, String expected) throws Exception
Exception
DEFAULT_DELTA
,
match(String,String,String,double)
public static String matchObj(String path, Object input, Object expected) throws Exception
Exception
DEFAULT_DELTA
,
matchObj(String,Object,Object,double)
public static String match(String input, String pathAndExpected, double delta) throws Exception
input
- JSON Structure to parse and test againstpathAndExpected
- JSON path expression + '==' + expected valuedelta
- tollerance allowed in comparing float/double valuesException
public static String matchObj(Object input, String pathAndExpected, double delta) throws Exception
input
- Object structure to parse and test againstpathAndExpected
- JSON path expression + '==' + expected valuedelta
- tollerance allowed in comparing float/double valuesException
public static String match(String path, String input, String expected, double delta) throws Exception
path
- JSON path expressioninput
- JSON Structure to parse and test againstexpected
- expected value of pathdelta
- tollerance allowed in comparing float/double valuesException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.