Package org.takes.facets.hamcrest
Class HmRqTextBody
- java.lang.Object
-
- org.hamcrest.BaseMatcher<T>
-
- org.hamcrest.TypeSafeMatcher<T>
-
- org.takes.facets.hamcrest.AbstractHmTextBody<Request>
-
- org.takes.facets.hamcrest.HmRqTextBody
-
- All Implemented Interfaces:
org.hamcrest.Matcher<Request>
,org.hamcrest.SelfDescribing
public final class HmRqTextBody extends AbstractHmTextBody<Request>
Request text body matcher.This "matcher" tests given request body, assuming that it has text content.
The class is immutable and thread-safe.
- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description HmRqTextBody(String expected)
Ctor with equalTo matcher and default charset.HmRqTextBody(org.hamcrest.Matcher<String> bdm)
Ctor with charset set to default one.HmRqTextBody(org.hamcrest.Matcher<String> bdm, Charset charset)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
itemBody(Request item)
Item's body.-
Methods inherited from class org.takes.facets.hamcrest.AbstractHmTextBody
describeMismatchSafely, describeTo, matchesSafely
-
-
-
-
Constructor Detail
-
HmRqTextBody
public HmRqTextBody(String expected)
Ctor with equalTo matcher and default charset.- Parameters:
expected
- String to test against
-
HmRqTextBody
public HmRqTextBody(org.hamcrest.Matcher<String> bdm)
Ctor with charset set to default one.- Parameters:
bdm
- Text body matcher
-
-
Method Detail
-
itemBody
public InputStream itemBody(Request item) throws IOException
Description copied from class:AbstractHmTextBody
Item's body.- Specified by:
itemBody
in classAbstractHmTextBody<Request>
- Parameters:
item
- Item to retrieve body from- Returns:
- InputStream of body
- Throws:
IOException
- If some problem inside
-
-