Package core.helpers
Class RestApiHelper
- java.lang.Object
-
- core.helpers.RestApiHelper
-
public class RestApiHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description RestApiHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidrunApiContaining(String identifier, String prefix, String getApi, String targetApiId, String variable, String targerApi)runApiContaining("name", "zzz_","getCompanies", "id","companyId","deleteCompany") get all companies with name containing zzz_, Then gets id of these companies, stores them in companyId variable And calls deleteCompanystatic voidrunApiEquals(String identifier, String value, String getApi, String targetApiId, String variable, String targerApi)runApiEquals("name", "test123","getCompanies", "id","companyId","deleteCompany") get all companies with name equals test123, Then gets id of these companies And calls delete with id
-
-
-
Method Detail
-
runApiContaining
public static void runApiContaining(String identifier, String prefix, String getApi, String targetApiId, String variable, String targerApi) throws org.json.JSONException
runApiContaining("name", "zzz_","getCompanies", "id","companyId","deleteCompany") get all companies with name containing zzz_, Then gets id of these companies, stores them in companyId variable And calls deleteCompany- Parameters:
getApi- : api to search for identifier. eg. name containing "zzz"prefix- : value containing in getApi. eg. name containing "zzz"identifier- : api to call to get all values. eg. getCompaniestargetApiId- : id used to call target api.eg. id for deleteCompany apivariable- : variable the id is stored in csv keyword file. eg companyIdtargerApi- : api to call. eg. deleteCompany- Throws:
org.json.JSONException
-
runApiEquals
public static void runApiEquals(String identifier, String value, String getApi, String targetApiId, String variable, String targerApi) throws org.json.JSONException
runApiEquals("name", "test123","getCompanies", "id","companyId","deleteCompany") get all companies with name equals test123, Then gets id of these companies And calls delete with id- Parameters:
getApi- : api to search for identifier. eg. name equals "test123"value- : value containing in getApi. eg. name equals "test123"identifier- : api to call to get all values. eg. getCompaniestargetApiId- : id used to call target api.eg. id for deleteCompany apivariable- : variable the id is stored in csv keyword file. eg companyIdtargerApi- : api to call. eg. deleteCompany- Throws:
org.json.JSONException
-
-