public class CrudDispatcher
extends okhttp3.mockwebserver.Dispatcher
| Modifier and Type | Field and Description |
|---|---|
protected AttributeExtractor |
attributeExtractor |
protected Context |
context |
protected Map<AttributeSet,String> |
map |
protected ResponseComposer |
responseComposer |
| Constructor and Description |
|---|
CrudDispatcher(Context context,
AttributeExtractor attributeExtractor,
ResponseComposer responseComposer) |
| Modifier and Type | Method and Description |
|---|---|
okhttp3.mockwebserver.MockResponse |
dispatch(okhttp3.mockwebserver.RecordedRequest request) |
AttributeExtractor |
getAttributeExtractor() |
Map<AttributeSet,String> |
getMap() |
ResponseComposer |
getResponseComposer() |
okhttp3.mockwebserver.MockResponse |
handleCreate(okhttp3.mockwebserver.RecordedRequest request) |
okhttp3.mockwebserver.MockResponse |
handleCreate(String path,
String body)
Adds the specified object to the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handleDelete(String path)
Performs a delete for the corresponding object from the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handleGet(String path)
Performs a get for the corresponding object from the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handlePatch(okhttp3.mockwebserver.RecordedRequest request) |
okhttp3.mockwebserver.MockResponse |
handlePatch(String path,
String body)
Patches the specified object to the in-memory db.
|
okhttp3.mockwebserver.MockResponse |
handleUpdate(okhttp3.mockwebserver.RecordedRequest request) |
okhttp3.mockwebserver.MockResponse |
handleUpdate(String path,
String body)
Updates the specified object to the in-memory db.
|
protected final Map<AttributeSet,String> map
protected final Context context
protected final AttributeExtractor attributeExtractor
protected final ResponseComposer responseComposer
public CrudDispatcher(Context context, AttributeExtractor attributeExtractor, ResponseComposer responseComposer)
public okhttp3.mockwebserver.MockResponse dispatch(okhttp3.mockwebserver.RecordedRequest request)
dispatch in class okhttp3.mockwebserver.Dispatcherpublic okhttp3.mockwebserver.MockResponse handleCreate(okhttp3.mockwebserver.RecordedRequest request)
public okhttp3.mockwebserver.MockResponse handleCreate(String path, String body)
path - for the request.body - Request body as String (UTF-8).public okhttp3.mockwebserver.MockResponse handlePatch(okhttp3.mockwebserver.RecordedRequest request)
public okhttp3.mockwebserver.MockResponse handlePatch(String path, String body)
path - for the request.body - Request body as String (UTF-8).public okhttp3.mockwebserver.MockResponse handleUpdate(okhttp3.mockwebserver.RecordedRequest request)
public okhttp3.mockwebserver.MockResponse handleUpdate(String path, String body)
path - for the request.body - Request body as String (UTF-8).public okhttp3.mockwebserver.MockResponse handleGet(String path)
path - for the request.public okhttp3.mockwebserver.MockResponse handleDelete(String path)
path - for the request.public Map<AttributeSet,String> getMap()
public AttributeExtractor getAttributeExtractor()
public ResponseComposer getResponseComposer()
Copyright © 2015–2024 Red Hat. All rights reserved.