forked from Zakaria/RestAssured
day 7: Authentication and Authorization
This commit is contained in:
@@ -74,8 +74,19 @@ public class AuthenticationTest {
|
||||
@Test(priority = 7)
|
||||
void testAPIKeyAuth() {
|
||||
|
||||
/* THIS METHOD 1
|
||||
given().queryParam("appid", "53f8437943998c07789a6693aec69607")
|
||||
.when().get("https://api.openweathermap.org/data/2.5/weather?q=Chicago&appid=53f8437943998c07789a6693aec69607")
|
||||
.when().get("https://api.openweathermap.org/data/2.5/weather?q=New York&appid=53f8437943998c07789a6693aec69607")
|
||||
.then().statusCode(200).log().all();
|
||||
*/
|
||||
//METHOD 2
|
||||
given()
|
||||
.pathParam("myPath", "data/2.5/weather")
|
||||
.queryParam("q", "New York")
|
||||
.queryParam("appid", "53f8437943998c07789a6693aec69607")
|
||||
.when()
|
||||
.get("https://api.openweathermap.org/{myPath}")
|
||||
.then().statusCode(200).log().all();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user