Skip to content

Commit f623b5d

Browse files
committed
Test added
1 parent 9cffb9c commit f623b5d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

passage/src/androidTest/java/id/passage/android/TokenStoreTests.kt

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import kotlinx.coroutines.delay
1717
import kotlinx.coroutines.runBlocking
1818
import kotlinx.coroutines.test.runTest
1919
import org.junit.After
20+
import org.junit.Assert.assertNotSame
2021
import org.junit.Assert.assertTrue
2122
import org.junit.Before
2223
import org.junit.Rule
@@ -167,4 +168,18 @@ internal class TokenStoreTests {
167168
assertThat(e is PassageTokenException)
168169
}
169170
}
171+
172+
@Test
173+
fun refreshWithValidToken(): Unit =
174+
runBlocking {
175+
try {
176+
val currentRefreshToken = refreshToken
177+
val authResult = passage.tokenStore.refreshAuthToken(currentRefreshToken)
178+
val newStoredRefreshToken = passage.tokenStore.refreshToken
179+
assertNotNull(authResult)
180+
assertNotSame(currentRefreshToken, newStoredRefreshToken)
181+
} catch (e: Exception) {
182+
assertThat(e is PassageTokenException)
183+
}
184+
}
170185
}

0 commit comments

Comments
 (0)