public static final class RqRegex.Fake extends Object implements RqRegex
Use this class in unit tests, when you need to create a fake version of a request with a matcher inside. For example:
new TkIndex().act( new RqRegex.Fake("/(.*)", "/hello") );
RqRegex.Fake
Constructor and Description |
---|
Fake(Request req,
Matcher matcher)
Ctor.
|
Fake(Request req,
String ptn,
CharSequence query)
Ctor.
|
Fake(String ptn,
CharSequence query)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
body()
HTTP request body.
|
Iterable<String> |
head()
All lines above the body.
|
Matcher |
matcher()
Get matcher of query string.
|
public Fake(String ptn, CharSequence query)
ptn
- Patternquery
- Querypublic Fake(Request req, String ptn, CharSequence query)
req
- Requestptn
- Patternquery
- Querypublic Matcher matcher()
RqRegex
public Iterable<String> head() throws IOException
Request
head
in interface Request
IOException
- If something goes wrongpublic InputStream body() throws IOException
Request
body
in interface Request
IOException
- If something goes wrongCopyright © 2015–2018 Take. All rights reserved.