From fc3dfdfd487b4a9e52a92d1631209c14a85be670 Mon Sep 17 00:00:00 2001 From: Sami Date: Tue, 15 Oct 2024 03:15:51 -0400 Subject: [PATCH] day 7: Authentication and Authorization --- pom.xml | 3 --- .../zacksolutions/DaySeven/AuthenticationTest.java | 13 ++++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index acf3b55..6019150 100644 --- a/pom.xml +++ b/pom.xml @@ -6,11 +6,8 @@ restAssured 1.0-SNAPSHOT jar - restAssured http://maven.apache.org - - 8 8 diff --git a/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java b/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java index cc0ea0b..9e95868 100644 --- a/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java +++ b/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java @@ -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(); + } }