FakeAuthorizationProvider
class FakeAuthorizationProvider(initialToken: String? = "token", refreshedToken: String? = "refreshed-token", refreshSucceeds: Boolean = true) : AuthorizationProvider
A scriptable AuthorizationProvider for tests. Tracks how many times a refresh was requested and can simulate refresh success or failure.
Parameters
initialToken
the token returned before any refresh, or null for no authorization.
refreshedToken
the token to switch to on a successful refresh.
refreshSucceeds
whether refreshAuthorizationIfNeeded reports success.
Properties
Link copied to clipboard
The token currently handed out.
Link copied to clipboard
How many times refreshAuthorizationIfNeeded has been invoked.