Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase token expiry time in tests #74

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ public void doAction(HttpURLConnection con) throws IOException {

@Test
public void httpUrlConnection_shouldNotRefreshLoopWhenExpiredTokenPassedInHeadersBeforeDoAction() throws Exception{
com.example.TestUtils.startST(1, true, 144000);
com.example.TestUtils.startST(3, true, 144000);
new SuperTokens.Builder(context, Constants.apiDomain).build();

//login request
Expand Down Expand Up @@ -1132,7 +1132,7 @@ public void doAction(HttpURLConnection con) throws IOException {
loginRequestConnection.disconnect();

// wait for access token expiry
Thread.sleep(2000);
Thread.sleep(4000);

String expiredAccessToken = Utils.getTokenForHeaderAuth(Utils.TokenType.ACCESS, context);

Expand Down Expand Up @@ -1163,7 +1163,7 @@ public void doAction(HttpURLConnection con) throws IOException {

@Test
public void httpUrlConnection_shouldNotRefreshLoopWhenExpiredTokenRetrievedInsideDoAction() throws Exception{
com.example.TestUtils.startST(1, true, 144000);
com.example.TestUtils.startST(3, true, 144000);
new SuperTokens.Builder(context, Constants.apiDomain).build();

//login request
Expand Down Expand Up @@ -1191,7 +1191,7 @@ public void doAction(HttpURLConnection con) throws IOException {
loginRequestConnection.disconnect();

// wait for access token expiry
Thread.sleep(2000);
Thread.sleep(4000);

int sessionRefreshCalledCount = com.example.TestUtils.getRefreshTokenCounter();
if (sessionRefreshCalledCount != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ public void okhttpHeaders_testShouldNotDoSessionRefreshIfMaxRetryAttemptsForSess

@Test
public void okHttpHeaders_shouldNotEndUpInRefreshLoopIfExpiredAccessTokenWasPassedInHeaders() throws Exception {
com.example.TestUtils.startST(1, true, 144000);
com.example.TestUtils.startST(3, true, 144000);
new SuperTokens.Builder(context, Constants.apiDomain)
.build();
JsonObject bodyJson = new JsonObject();
Expand All @@ -1239,7 +1239,7 @@ public void okHttpHeaders_shouldNotEndUpInRefreshLoopIfExpiredAccessTokenWasPass
loginResponse.close();

// wait for the token to expire
Thread.sleep(2000);
Thread.sleep(4000);

int sessionRefreshCalledCount = com.example.TestUtils.getRefreshTokenCounter();
if (sessionRefreshCalledCount != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ public void retrofitHeaders_testShouldNotDoSessionRefreshIfMaxRetryAttemptsForSe

@Test
public void retrofitHeaders_shouldNotEndUpInRefreshLoopIfExpiredAccessTokenWasPassedInHeaders() throws Exception {
com.example.TestUtils.startST(1, true, 144000);
com.example.TestUtils.startST(3, true, 144000);
new SuperTokens.Builder(context, Constants.apiDomain)
.build();

Expand All @@ -833,7 +833,7 @@ public void retrofitHeaders_shouldNotEndUpInRefreshLoopIfExpiredAccessTokenWasPa
}

// wait for the token to expire
Thread.sleep(2000);
Thread.sleep(4000);

int sessionRefreshCalledCount = com.example.TestUtils.getRefreshTokenCounter();
if (sessionRefreshCalledCount != 0) {
Expand Down
Loading