public class DataHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
VERIFY_JSON_PART_INDICATOR |
static String |
VERIFY_RESPONSE_BODY_INDICATOR |
| Constructor and Description |
|---|
DataHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertTemplateToString(String templateFilePath) |
static File |
getFile(String filename) |
static int |
getIntFromString(String value) |
static String |
getServiceObjectTemplateString(ServiceObject serviceObject)
returns service object template file as string
Template file name is from Template column in csv
|
static String |
getTagValue(String requestBody,
String tag)
get value in between tags >value<
|
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 String |
listToString(List<String> values)
converts list to string separated by ","
|
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 void |
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 String replaceParameters(String source)
source - public static int getIntFromString(String value)
public static List<KeyValue> getValidationMap(String expected)
expected - public static String getTagValue(String requestBody, String tag)
requestBody - tag - public static String getServiceObjectTemplateString(ServiceObject serviceObject)
apiObject - IOExceptionpublic static void 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 String listToString(List<String> values)
values - Copyright © 2019. All rights reserved.