TestHttpOverrides class

Test HttpOverrides that returns its own mock client when createHttpClient is called.

The client will be a mockito client whose responses can be mocked.

When loading images, consider using stubOpenUrlCallsWithTransparentImage to stub out the mock client's http calls so they return kTransparentImage.

Inheritance

Constructors

TestHttpOverrides()

Properties

client MockHttpClient
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createHttpClient(SecurityContext? context) HttpClient
Returns a new HttpClient using the given context.
override
findProxyFromEnvironment(Uri url, Map<String, String>? environment) String
Resolves the proxy server to be used for HTTP connections.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stubOpenUrlCallsWithTransparentImage() → void
Stubs calls to HttpClient.openUrl on the client to return a transparent image.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited