Registry / testing / retrofit-mock

retrofit-mock

JSON →
library3.0.0javamavenunverified

Retrofit add-on for creating mock implementations of HTTP services for testing.

<dependency> <groupId>com.squareup.retrofit2</groupId> <artifactId>retrofit-mock</artifactId> <version>3.0.0</version> </dependency>
INSTALL
IMPORT
SIG · RETROFIT-MOCK
R
retrofit-mock
testingjavav3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MockRetrofit
retrofit2.mock.MockRetrofit

Creates a MockRetrofit instance with simulated network behavior.

import retrofit2.Retrofit; import retrofit2.mock.MockRetrofit; import retrofit2.mock.NetworkBehavior; public class MockExample { public static void main(String[] args) { Retrofit retrofit = new Retrofit.Builder().baseUrl("http://test.com").build(); NetworkBehavior behavior = NetworkBehavior.create(); MockRetrofit mockRetrofit = new MockRetrofit.Builder(retrofit) .networkBehavior(behavior) .build(); System.out.println("MockRetrofit created"); } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.0.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
retrofit-mock — mvn dependency:get retrofit-mock · libregistry