public class DataHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
VERIFY_JSON_PART_INDICATOR |
static String |
VERIFY_RESPONSE_BODY_INDICATOR |
static String |
VERIFY_RESPONSE_NO_EMPTY |
| Constructor and Description |
|---|
DataHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
compareNumbers(double value1,
double value2,
String comparator)
compare integer values
|
static boolean |
compareNumbers(String value1,
String value2,
String comparator)
compare string integer values based on comparator value
|
static String |
convertTemplateToString(String templateFilePath) |
static File |
getFile(String filename) |
static String |
getServiceObjectTemplateString(ServiceObject serviceObject)
returns service object template file as string
Template file name is from Template column in csv
|
static String |
getTemplateFileLocation(String file) |
static Path |
getTemplateFilePath(String file) |
static List<KeyValue> |
getValidationMap(String expected)
gets the map of the validation requirements
split by ";"
|
static boolean |
isEmpty(String value) |
static boolean |
isGreaterThan(String value1,
String value2) |
static boolean |
isLessThan(String value1,
String value2) |
static String |
listToString(List<String> values)
converts list to string separated by ","
|
static String |
ObjectToString(Object values)
convert object to string
object can be array
|
static String |
replaceParameters(String source)
replaces placeholder values with values from config properties replaces only
string values
|
static List<String> |
splitRight(String value,
String regex,
int limit) |
static String |
validateCommand(String command,
String responseString,
String expectedString)
validates response against expected values
|
static String |
validateCommand(String command,
String responseString,
String expectedString,
String position)
validates response against expected values
|
public static final String VERIFY_JSON_PART_INDICATOR
public static final String VERIFY_RESPONSE_BODY_INDICATOR
public static final String VERIFY_RESPONSE_NO_EMPTY
public static String replaceParameters(String source)
source - public static List<KeyValue> getValidationMap(String expected)
expected - public static String getServiceObjectTemplateString(ServiceObject serviceObject)
apiObject - IOExceptionpublic static String validateCommand(String command, String responseString, String expectedString)
command - responseString - expectedString - public static String validateCommand(String command, String responseString, String expectedString, String position)
command - responseString - expectedString - position - public static boolean compareNumbers(String value1, String value2, String comparator)
value1 - value2 - comparator - public static boolean compareNumbers(double value1,
double value2,
String comparator)
value1 - value2 - comparator - public static String listToString(List<String> values)
values - public static String ObjectToString(Object values)
values - public static boolean isEmpty(String value)
Copyright © 2019. All rights reserved.