Skip to content

Commit

Permalink
[T] Test restoreSession()
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Dec 6, 2019
1 parent b91698e commit df228f7
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions src/test/java/org/hydev/veracross/sdk/StJohnsHttpClientTest.java
Original file line number Diff line number Diff line change
@@ -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.*;
Expand All @@ -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<List<BasicClientCookie>>(){}.getType()));
veracross.restoreSession(SESSION);
}

@Test @Order(2)
Expand Down Expand Up @@ -138,7 +119,7 @@ void veracrossDirectoryFaculty() throws IOException
void testGrading() throws IOException
{
// Get grading info
List<VeraCourseGrading> gradings = veracross.getGradings(courses);
List<VeraCourseGrading> gradings = veracross.getGradings(courses.get(1));
log(gradings);
}

Expand Down

0 comments on commit df228f7

Please sign in to comment.