package com.isidroid.spot.data.source.remote

import android.content.Context
import com.isidroid.network.ext.createMockResponse
import okhttp3.Interceptor
import okhttp3.Response

internal class MockInterceptor(
    private val context: Context,
    private val isMock: Boolean
) : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        if (!isMock)
            return chain.proceed(chain.request())

        return createMockResponse(context, chain.request())
    }
}