Package ai.rev.helpers
Class MockInterceptor
- java.lang.Object
-
- ai.rev.helpers.MockInterceptor
-
- All Implemented Interfaces:
okhttp3.Interceptor
public class MockInterceptor extends Object implements okhttp3.Interceptor
A MockInterceptor object is used to mock the responses for testing purposes.
-
-
Field Summary
Fields Modifier and Type Field Description okhttp3.Requestrequest
-
Constructor Summary
Constructors Constructor Description MockInterceptor(okhttp3.MediaType mediaType, Integer responseCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.MediaTypegetMediaType()okhttp3.RequestgetRequest()IntegergetResponseCode()StringgetSampleResponse()okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)voidsetMediaType(okhttp3.MediaType mediaType)voidsetRequest(okhttp3.Request request)voidsetResponseCode(Integer responseCode)voidsetSampleResponse(String sampleResponse)
-
-
-
Constructor Detail
-
MockInterceptor
public MockInterceptor(okhttp3.MediaType mediaType, Integer responseCode)
-
-
Method Detail
-
intercept
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException- Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-
getSampleResponse
public String getSampleResponse()
-
setSampleResponse
public void setSampleResponse(String sampleResponse)
-
getRequest
public okhttp3.Request getRequest()
-
setRequest
public void setRequest(okhttp3.Request request)
-
getMediaType
public okhttp3.MediaType getMediaType()
-
setMediaType
public void setMediaType(okhttp3.MediaType mediaType)
-
getResponseCode
public Integer getResponseCode()
-
setResponseCode
public void setResponseCode(Integer responseCode)
-
-