Class WebServerDispatcher
- java.lang.Object
-
- okhttp3.mockwebserver.Dispatcher
-
- com.google.android.exoplayer2.testutil.WebServerDispatcher
-
public class WebServerDispatcher extends okhttp3.mockwebserver.DispatcherADispatcherforMockWebServerthat allows per-path customisation of the static data served.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWebServerDispatcher.ResourceA resource served byWebServerDispatcher.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.mockwebserver.MockResponsedispatch(okhttp3.mockwebserver.RecordedRequest request)static WebServerDispatcherforResources(Iterable<WebServerDispatcher.Resource> resources)Constructs a dispatcher that handles requests based the providedWebServerDispatcher.Resourceinstances.static StringgetRequestPath(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.Resourceinstances.
-
dispatch
public okhttp3.mockwebserver.MockResponse dispatch(okhttp3.mockwebserver.RecordedRequest request)
- Specified by:
dispatchin classokhttp3.mockwebserver.Dispatcher
-
-