@Override protected void describeMismatchSafely(Response response, Description mismatchDescription) { List<Header> headers = response.getHeaders(); if (headers.isEmpty()) { mismatchDescription.appendText("Response has no headers"); } else { mismatchDescription.appendText("Response has headers [" + StringUtils.join(response.getHeaders(), ", ") + "]"); } }
@Override protected void describeMismatchSafely(Response response, Description mismatchDescription) { List<Header> headers = response.getHeaders(); if (headers.isEmpty()) { mismatchDescription.appendText("Response has no headers"); } else { mismatchDescription.appendText("Response has headers [" + StringUtils.join(response.getHeaders(), ", ") + "]"); } } }
@Override protected void describeMismatchSafely(Response response, Description mismatchDescription) { List<Header> headers = response.getHeaders(); if (headers.isEmpty()) { mismatchDescription.appendText("Response has no headers"); } else { mismatchDescription.appendText("Response has headers [" + StringUtils.join(response.getHeaders(), ", ") + "]"); } }
@Override protected void describeMismatchSafely(Response response, Description mismatchDescription) { List<Header> headers = response.getHeaders(); if (headers.isEmpty()) { mismatchDescription.appendText("Response has no headers"); } else { mismatchDescription.appendText("Response has headers [" + StringUtils.join(response.getHeaders(), ", ") + "]"); } } }
@Override protected boolean matchesSafely(Response response) { for (Header header : response.getHeaders()) { if (StringUtils.equalsIgnoreCase(header.getName(), name)) { return true; } } return false; }
@Override protected boolean matchesSafely(Response response) { for (Header header : response.getHeaders()) { if (StringUtils.equalsIgnoreCase(header.getName(), name)) { return true; } } return false; }
@Override protected boolean matchesSafely(Response response) { for (Header header : response.getHeaders()) { if (!StringUtils.equalsIgnoreCase(header.getName(), name)) { continue; } return valueMatcher.matches(header.getValue()); } return false; }
@Override protected boolean matchesSafely(Response response) { for (Header header : response.getHeaders()) { if (!StringUtils.equalsIgnoreCase(header.getName(), name)) { continue; } return valueMatcher.matches(header.getValue()); } return false; }