public static final class RqFallback.Fake extends Object implements RqFallback
Use this class in unit tests, when you need to create a fake version of a request with an exception inside. For example:
new TkIndex().act( new RqFallback.Fake("/(.*)", "/hello") );
RqFallback.Fake
Constructor and Description |
---|
RqFallback.Fake(int code)
Ctor.
|
RqFallback.Fake(int code,
Throwable error)
Ctor.
|
RqFallback.Fake(Request req,
int code,
Throwable error)
Ctor.
|
public RqFallback.Fake(int code)
code
- HTTP status codepublic RqFallback.Fake(int code, Throwable error)
code
- HTTP status codeerror
- Exceptionpublic int code()
RqFallback
code
in interface RqFallback
public Throwable throwable()
RqFallback
throwable
in interface RqFallback
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 Take. All rights reserved.