Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
/ FlipMockAndroid Public archive

FlipMock is a extended Flipper plugin that manipulates network response.

Notifications You must be signed in to change notification settings

enciyo/FlipMockAndroid

Repository files navigation

logo

FlipMock

version

FlipMock is a extended Flipper plugin that manipulates network response.

Table of Contents

SDK Features

Waiting for FlipMock Desktop Plugin support

  • Mock the response by HTTP method.
  • Mock the response by query parameters.
  • For response, support HTTP code

Installation

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.enciyo:FlipMock:$version'
}

Using FlipMock

Application

class FlipperApp : Application() {

    companion object {
        val flipMockPlugin = FlipMockPlugin.getInstance()
    }

    override fun onCreate() {
        super.onCreate()
        
        val client = AndroidFlipperClient.getInstance(this)
        ///....    
        client.addPlugin(flipMockPlugin)
        ///...
        client.start()
    }

}

OkHttp

   fun provideOkHttpClient(): OkHttpClient {
        val okhttp = OkHttpClient.Builder()
        if (BuildConfig.DEBUG){
            okhttp.addInterceptor(FlipperApp.flipMockPlugin.interceptor)
        }
        return okhttp.build()
    }

How can I mock the response?

In this section, you can mock response using FlipMock desktop Plugin on the Flipper.

How to use FlipMock Desktop Plugin?

About

FlipMock is a extended Flipper plugin that manipulates network response.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages