我有2个课程
class APIDriver
protected RequestSpecification generateCommonReqSpecJsonWithQueryParams(Map<String, Object> params)
{
return given().accept(ContentType.JSON).queryParams(params);
}
public class Demo extends APIDriver{
@Test (groups = "sanity", description = "first API test")
public void givenUserDoesNotExists_whenUserInfoIsRetrieved_then404IsReceived()
throws Exception {
ExtentTestManager.getTest().log(LogStatus.INFO, "Test started");
String name = RandomStringUtils.randomAlphabetic( 8 );
String url = "https://api.github.com/users/" + name;
RequestSpecification spec = generateCommonReqSpecJsonWithQueryParams(//);
Response resp = RestOperationUtils.get(url, spec, null);
APIResponse apiResp = new APIResponse(resp);
assert apiResp.getStatusCode()==404;
我该如何在请求中传递以下参数及其值?
param1
(key--->1234)
param2
(loc--->34.56)