From df228f789670f5679f5754ec1fd6680b8cf8e538 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Thu, 5 Dec 2019 21:40:01 -0500 Subject: [PATCH] [T] Test restoreSession() --- .../veracross/sdk/StJohnsHttpClientTest.java | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/test/java/org/hydev/veracross/sdk/StJohnsHttpClientTest.java b/src/test/java/org/hydev/veracross/sdk/StJohnsHttpClientTest.java index 6176ffc..9461d78 100644 --- a/src/test/java/org/hydev/veracross/sdk/StJohnsHttpClientTest.java +++ b/src/test/java/org/hydev/veracross/sdk/StJohnsHttpClientTest.java @@ -1,9 +1,7 @@ package org.hydev.veracross.sdk; import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import org.apache.http.cookie.Cookie; -import org.apache.http.impl.cookie.BasicClientCookie; import org.hydev.veracross.sdk.exceptions.VeracrossException; import org.hydev.veracross.sdk.model.*; import org.junit.jupiter.api.*; @@ -26,32 +24,15 @@ @TestInstance(TestInstance.Lifecycle.PER_CLASS) class StJohnsHttpClientTest { - private StJohnsHttpClient stJohns; - private VeracrossHttpClient veracross; - /* - @Test @Order(1) - void login() throws IOException, VeracrossException - { - // Login St Johns - stJohns.login(username, password); - } - - @Test @Order(2) - void veracross() throws IOException, VeracrossException - { - // Login Veracross - veracross = stJohns.veracrossLoginSSO(); - } - */ + private VeracrossHttpClient veracross; - @Test @Order(1) - void veracross() throws IOException, VeracrossException + @Test @BeforeAll + void init() throws IOException, VeracrossException { // Login Veracross veracross = new VeracrossHttpClient(); - veracross.restoreCookies(new Gson().fromJson("-- HIDDEN --", - new TypeToken>(){}.getType())); + veracross.restoreSession(SESSION); } @Test @Order(2) @@ -138,7 +119,7 @@ void veracrossDirectoryFaculty() throws IOException void testGrading() throws IOException { // Get grading info - List gradings = veracross.getGradings(courses); + List gradings = veracross.getGradings(courses.get(1)); log(gradings); }