Skip to content

Commit

Permalink
Merge pull request #83 from passageidentity/PSG-5003
Browse files Browse the repository at this point in the history
PSG-5003
  • Loading branch information
SinaSeylani authored Oct 15, 2024
2 parents 388817a + f623b5d commit 5ce6cb5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions passage/src/androidTest/java/id/passage/android/TokenStoreTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.runTest
import org.junit.After
import org.junit.Assert.assertNotSame
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
Expand Down Expand Up @@ -167,4 +168,18 @@ internal class TokenStoreTests {
assertThat(e is PassageTokenException)
}
}

@Test
fun refreshWithValidToken(): Unit =
runBlocking {
try {
val currentRefreshToken = refreshToken
val authResult = passage.tokenStore.refreshAuthToken(currentRefreshToken)
val newStoredRefreshToken = passage.tokenStore.refreshToken
assertNotNull(authResult)
assertNotSame(currentRefreshToken, newStoredRefreshToken)
} catch (e: Exception) {
assertThat(e is PassageTokenException)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class PassageTokenStore(
} catch (e: Exception) {
throw PassageTokenException.convert(e)
}
setTokens(apiAuthResult)
return apiAuthResult
}

Expand Down

0 comments on commit 5ce6cb5

Please sign in to comment.