aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-11-14 11:13:41 +0100
committeradamw <adam@warski.org>2017-11-14 11:13:41 +0100
commit669c758e4a6cdb82b48ed5de5752c7802b52fef5 (patch)
treeed79f02290c825a92c507457805e1166e9e66f5b /core
parent3e808474fa156760312228dff68fb05dccb48d7f (diff)
downloadsttp-669c758e4a6cdb82b48ed5de5752c7802b52fef5.tar.gz
sttp-669c758e4a6cdb82b48ed5de5752c7802b52fef5.tar.bz2
sttp-669c758e4a6cdb82b48ed5de5752c7802b52fef5.zip
#45: add matching on any request
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/com/softwaremill/sttp/testing/SttpBackendStub.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/main/scala/com/softwaremill/sttp/testing/SttpBackendStub.scala b/core/src/main/scala/com/softwaremill/sttp/testing/SttpBackendStub.scala
index 114cd61..9bd3120 100644
--- a/core/src/main/scala/com/softwaremill/sttp/testing/SttpBackendStub.scala
+++ b/core/src/main/scala/com/softwaremill/sttp/testing/SttpBackendStub.scala
@@ -43,6 +43,14 @@ class SttpBackendStub[R[_], S] private (
new WhenRequest(p)
/**
+ * Specify how the stub backend should respond to any request (catch-all).
+ *
+ * Note that the stubs are immutable, and each new
+ * specification that is added yields a new stub instance.
+ */
+ def whenAnyRequest: WhenRequest = whenRequestMatches(_ => true)
+
+ /**
* Specify how the stub backend should respond to requests using the
* given partial function.
*