|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.kristofa.test.http.ContentMatcher
public abstract class ContentMatcher
The content of a HttpRequest or response can be structured data like JSON / XML.
HttpRequestImpl treats content as a byte array by default. However in the case JSON / XML you can have a non equal
byte array which still gives you the same representation: for example different order of properties in json..
To be able to have custom equals/hashcode logic you can set your own ContentMatcher when building a
HttpRequestImpl.
HttpRequestImpl| Constructor Summary | |
|---|---|
ContentMatcher()
|
|
| Method Summary | |
|---|---|
abstract ContentMatcher |
copy()
Create a copy of this ContentProxy. |
abstract boolean |
equals(Object obj)
|
abstract byte[] |
getContent()
Gets content. |
abstract int |
hashCode()
|
abstract void |
setContent(byte[] content)
Sets content. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentMatcher()
| Method Detail |
|---|
public abstract byte[] getContent()
public abstract void setContent(byte[] content)
throws UnexpectedContentException
content - Content.
UnexpectedContentException - In case we don't expect given content. This matcher is incompatible with given
content.public abstract boolean equals(Object obj)
equals in class Objectpublic abstract int hashCode()
hashCode in class Objectpublic abstract ContentMatcher copy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||