public class XPathBodyTypeAdapter extends BodyTypeAdapter
| Constructor and Description |
|---|
XPathBodyTypeAdapter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object expected,
Object actual)
Equality check for bodies.
|
protected boolean |
eval(String expr,
String content) |
Object |
parse(String expectedListOfXpathsAsString)
Parses the expected body in the current test.
|
String |
toXmlString(String content) |
checkNoBody, getCharset, setCharset, toStringaddError, fromString, get, getContext, getErrors, set, setContext, toStringpublic boolean equals(Object expected, Object actual)
List<String> of XPaths - as parsed by
parse(String ) - to be executed in the
actual body. The check is true if all XPaths executed in the actual body
return a node list not null or empty.
A special case is dedicated to no-body. If the expected body is
no-body, the equality check is true if the actual body returned
by the REST response is empty or null.equals in class fit.TypeAdapterexpected - the expected body, it's a string with XPaths separated by
System.getProperty("line.separator")actual - the body of the REST response returned by the call in the
current test rowTypeAdapterpublic Object parse(String expectedListOfXpathsAsString) throws Exception
A body is a String containing XPaths one for each new line. Empty body
would result in an empty List<String>. A body containing the
value no-body is especially treated separately.
parse in class fit.TypeAdapterexpectedListOfXpathsAsString - expected list of xpaths as stringExceptionpublic String toXmlString(String content)
toXmlString in class BodyTypeAdaptercontent - the content of the body response to be XMLified.Copyright © 2017 smartrics. All rights reserved.