retrofit-mock / retrofit2.mock / Calls

Calls

class Calls

Factory methods for creating Call instances which immediately respond or fail.

Functions

defer

static fun <T : Any!> defer(callable: Callable<Call<T>!>!): Call<T>!

Invokes callable once for the returned Call and once for each instance that is obtained from cloning the returned Call.

failure

static fun <T : Any!> failure(failure: IOException!): Call<T>!

Creates a failed Call from failure.

static fun <T : Any!> failure(failure: Throwable!): Call<T>!

Creates a failed Call from failure.

response

static fun <T : Any!> response(successValue: T?): Call<T>!
static fun <T : Any!> response(response: Response<T>!): Call<T>!