Class WebServerDispatcher
- java.lang.Object
-
- okhttp3.mockwebserver.Dispatcher
-
- com.google.android.exoplayer2.testutil.WebServerDispatcher
-
public class WebServerDispatcher extends okhttp3.mockwebserver.Dispatcher
ADispatcher
forMockWebServer
that allows per-path customisation of the static data served.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebServerDispatcher.Resource
A resource served byWebServerDispatcher
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.mockwebserver.MockResponse
dispatch(okhttp3.mockwebserver.RecordedRequest request)
static WebServerDispatcher
forResources(Iterable<WebServerDispatcher.Resource> resources)
Constructs a dispatcher that handles requests based the providedWebServerDispatcher.Resource
instances.static String
getRequestPath(okhttp3.mockwebserver.RecordedRequest request)
Returns the path for a givenRecordedRequest
, stripping any query parameters.
-
-
-
Method Detail
-
getRequestPath
public static String getRequestPath(okhttp3.mockwebserver.RecordedRequest request)
Returns the path for a givenRecordedRequest
, stripping any query parameters.
-
forResources
public static WebServerDispatcher forResources(Iterable<WebServerDispatcher.Resource> resources)
Constructs a dispatcher that handles requests based the providedWebServerDispatcher.Resource
instances.
-
dispatch
public okhttp3.mockwebserver.MockResponse dispatch(okhttp3.mockwebserver.RecordedRequest request)
- Specified by:
dispatch
in classokhttp3.mockwebserver.Dispatcher
-
-