android-components / mozilla.components.tooling.fetch.tests / FetchTestCases

FetchTestCases

abstract class FetchTestCases (source)

Generic test cases for concept-fetch implementations.

We expect any implementation of concept-fetch to pass all test cases here.

Constructors

Name Summary
<init> FetchTestCases()
Generic test cases for concept-fetch implementations.

Functions

Name Summary
createNewClient abstract fun createNewClient(): Client
Creates a new Client for running a specific test case with it.
createWebServer open fun createWebServer(): MockWebServer
Creates a new MockWebServer to accept test requests.
get200OverridingDefaultHeaders open fun get200OverridingDefaultHeaders(): Unit
get200WithCacheControl open fun get200WithCacheControl(): Unit
get200WithContentTypeCharset open fun get200WithContentTypeCharset(): Unit
get200WithCookiePolicy open fun get200WithCookiePolicy(): Unit
get200WithDefaultHeaders open fun get200WithDefaultHeaders(): Unit
get200WithDuplicatedCacheControlRequestHeaders open fun get200WithDuplicatedCacheControlRequestHeaders(): Unit
get200WithDuplicatedCacheControlResponseHeaders open fun get200WithDuplicatedCacheControlResponseHeaders(): Unit
get200WithGzippedBody open fun get200WithGzippedBody(): Unit
get200WithHeaders open fun get200WithHeaders(): Unit
get200WithReadTimeout open fun get200WithReadTimeout(): Unit
get200WithStringBody open fun get200WithStringBody(): Unit
get200WithUserAgent open fun get200WithUserAgent(): Unit
get302FollowRedirects open fun get302FollowRedirects(): Unit
get302FollowRedirectsDisabled open fun get302FollowRedirectsDisabled(): Unit
get404WithBody open fun get404WithBody(): Unit
getDataUri open fun getDataUri(): Unit
getThrowsIOExceptionWhenHostNotReachable open fun getThrowsIOExceptionWhenHostNotReachable(): Unit
post200WithBody open fun post200WithBody(): Unit
put201FileUpload open fun put201FileUpload(): Unit

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.