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