Package com.apollographql.apollo3.testing
Types
Link copied to clipboard
Link copied to clipboard
class MockServerTest( val mockServer: MockServer, val apolloClient: ApolloClient, val scope: CoroutineScope)
Content copied to clipboard
Link copied to clipboard
Link copied to clipboard
class TestTokenProvider(currentAccessToken: String, val newAccessToken: String) : TokenProvider
Content copied to clipboard
Functions
Link copied to clipboard
fun <D : Operation.Data> MockServer.enqueue( operation: Operation<D>, data: D, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, delayMs: Long = 0)
Content copied to clipboard
Link copied to clipboard
fun MockServer.enqueueData( data: Operation.Data, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, delayMs: Long = 0, statusCode: Int = 200)
Content copied to clipboard
fun MockServer.enqueueData( data: Map<String, Any?>, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, delayMs: Long = 0, statusCode: Int = 200)
Content copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <D : Operation.Data> ApolloClient.enqueueTestResponse(response: ApolloResponse<D>)
Content copied to clipboard
fun <D : Operation.Data> ApolloClient.enqueueTestResponse( operation: Operation<D>, data: D? = null, errors: List<Error>? = null)
Content copied to clipboard
Link copied to clipboard
A convenience function that makes sure the MockServer and ApolloClient are properly closed at the end of the test
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun <T> Channel<T>.receiveOrTimeout(timeoutMillis: Long = 500): T
Content copied to clipboard
Link copied to clipboard
fun <D : Operation.Data> ApolloClient.registerTestNetworkError(operation: Operation<D>)
Content copied to clipboard
Link copied to clipboard
fun <D : Operation.Data> ApolloClient.registerTestResponse(operation: Operation<D>, response: ApolloResponse<D>)
Content copied to clipboard
fun <D : Operation.Data> ApolloClient.registerTestResponse( operation: Operation<D>, data: D? = null, errors: List<Error>? = null)
Content copied to clipboard
Link copied to clipboard
Content copied to clipboard
Link copied to clipboard