Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support exceptions in SttpBackendStub #43

Closed
klappenbach opened this issue Nov 8, 2017 · 1 comment
Closed

Support exceptions in SttpBackendStub #43

klappenbach opened this issue Nov 8, 2017 · 1 comment

Comments

@klappenbach
Copy link

Would be nice if something like this was supported:

implicit val testingBackend: SttpBackendStub[Future, Nothing] = SttpBackendStub(AkkaHttpBackend())
    .whenRequestMatches(_.uri.path.nonEmpty)
    .thenRespond(throw SomeException("Timeout or something else happened"))

This way you can write tests that describes certain cases, such as timout or connection errors.

@adamw
Copy link
Member

adamw commented Nov 13, 2017

Please test 1.0.3 & see the docs at http://sttp.readthedocs.io/en/latest/testing.html!

@adamw adamw closed this as completed Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants