NetworkMocker
Can be used for registering Mocked data, returned by the MockingURLProtocol
.
-
The way Mocker handles unregistered urls
See more -
The mode defines how unknown URLs are handled. Defaults to
optin
which means requests without a mock are ignored. -
The HTTP Version to use in the mocked response.
-
URLs to ignore for mocking.
-
Enable request mock for NetworkAgent.
-
Register new Mocked data. If a mock for the same URL and HTTPMethod exists, it will be overwritten.
-
Register an URL to ignore for mocking. This will let the URL work as if the Mocker doesn’t exist.
-
Checks if the passed URL should be handled by the Mocker. If the URL is registered to be ignored, it will not handle the URL.
-
Removes all registered mocks. Use this method in your tearDown function to make sure a Mock is not used in any other test.