* The given content type must fully match including type, sub-type, and
* parameters. For checking only the type and sub-type see
* {@link #contentTypeCompatibleWith(MediaType)}.
*/
public ResultMatcher contentType(final MediaType contentType) {
return new ResultMatcher() {
@Override
public void match(MvcResult result) throws Exception {
String actual = result.getResponse().getContentType();
assertTrue("Content type not set", actual != null);
assertEquals("Content type", contentType, MediaType.parseMediaType(actual));