Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class ContentResultMatchers
- Object
- ContentResultMatchers
Expectations of the response body, from
MockMvcResultMatchers.content.Methods
public ResultMatcher string(String expected) | The body is exactly this text. |
public ResultMatcher bytes(byte[] expected) | The body is exactly these bytes. |
public ResultMatcher contentType(String expected) | The Content-Type is this one, parameters included when it names any: application/json matches application/json;charset=utf-8, which a stricter test names in full. |
public ResultMatcher contentTypeCompatibleWith(String expected) | The Content-Type’s type and subtype are compatible with this one; application/* and */* match anything in their range. |
public ResultMatcher json(String expected) | The body is JSON holding everything expected does; objects may carry more fields. |
public ResultMatcher json(String expected, boolean strict) |
Inherited methods
Method details
string
public ResultMatcher string(String expected)The body is exactly this text.
bytes
public ResultMatcher bytes(byte[] expected)The body is exactly these bytes.
contentType
public ResultMatcher contentType(String expected)The Content-Type is this one, parameters included when it names any:
application/json matches application/json;charset=utf-8, which a
stricter test names in full.contentTypeCompatibleWith
public ResultMatcher contentTypeCompatibleWith(String expected)The Content-Type’s type and subtype are compatible with this one;
application/* and */* match anything in their range.json
public ResultMatcher json(String expected)The body is JSON holding everything
expected does; objects may carry
more fields. json(String, boolean) with true asks for exact equality.json
public ResultMatcher json(String expected, boolean strict)