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

Match any url in SttpBackendStub #45

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

Match any url in SttpBackendStub #45

klappenbach opened this issue Nov 8, 2017 · 1 comment

Comments

@klappenbach
Copy link

Currently (I think) the only way to match any url is using .whenRequestMatches(_.uri.path.nonEmpty).
A simpler option would be handy, something like:

implicit val testingBackend: SttpBackendStub[Future, Nothing] = SttpBackendStub(AkkaHttpBackend())
    .whenAnyRequest
    .thenRespond( ... )

or perhaps

implicit val testingBackend: SttpBackendStub[Future, Nothing] = SttpBackendStub(AkkaHttpBackend())
    .whenRequestMatches(any)
    .thenRespond( ... )
@adamw
Copy link
Member

adamw commented Nov 10, 2017

I suppose you can also do .whenRequestMatches(_ => true)?

adamw added a commit that referenced this issue Nov 14, 2017
@adamw adamw closed this as completed Nov 14, 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