diff --git a/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java b/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java index cd7aab2..df17c90 100644 --- a/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java +++ b/src/test/java/zacksolutions/DaySeven/AuthenticationTest.java @@ -51,13 +51,23 @@ public class AuthenticationTest { .then().statusCode(200).log().all(); } - @Test(priority = 5) + // @Test(priority = 5) void testOAuth1Auth() { System.out.println("Starting the authenticantion using OAuth1 auth"); - String bearerToken = "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"; + given() + .auth().oauth("consumerKey", "consumerSecret", "accessToken", "tokenSecret") + .when() + .get("https://api.github.com/user/repos") + .then().statusCode(200).log().all(); + } - given().headers("Authorization", "Bearer " + bearerToken) - .when().get("https://api.github.com/user/repos") + @Test(priority = 6) + void testOAuth2Auth() { + System.out.println("Starting the authenticantion using OAuth2 auth"); + given() + .auth().oauth2("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") + .when() + .get("https://api.github.com/user/repos") .then().statusCode(200).log().all(); } }