"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient5/src/test/java/org/apache/hc/client5/http/HeaderMatcher.java" between
httpcomponents-client-5.2-src.tar.gz and httpcomponents-client-5.2.1-src.tar.gz

About: Apache HttpComponents Client provides reusable components for client-side authentication, HTTP state management, and HTTP connection management. Java sources.

HeaderMatcher.java  (httpcomponents-client-5.2-src):HeaderMatcher.java  (httpcomponents-client-5.2.1-src)
skipping to change at line 29 skipping to change at line 29
* ==================================================================== * ====================================================================
* *
* This software consists of voluntary contributions made by many * This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more * individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
* *
*/ */
package org.apache.hc.client5.http; package org.apache.hc.client5.http;
import java.util.Objects;
import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.util.LangUtils;
import org.hamcrest.BaseMatcher; import org.hamcrest.BaseMatcher;
import org.hamcrest.Description; import org.hamcrest.Description;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
public class HeaderMatcher extends BaseMatcher<Header> { public class HeaderMatcher extends BaseMatcher<Header> {
private final String headerName; private final String headerName;
private final Object headerValue; private final Object headerValue;
public HeaderMatcher(final String headerName, final Object headerValue) { public HeaderMatcher(final String headerName, final Object headerValue) {
this.headerName = headerName; this.headerName = headerName;
this.headerValue = headerValue; this.headerValue = headerValue;
} }
@Override @Override
public boolean matches(final Object item) { public boolean matches(final Object item) {
if (item instanceof Header) { if (item instanceof Header) {
final Header header = (Header) item; final Header header = (Header) item;
return headerName.equalsIgnoreCase(header.getName()) && LangUtils.eq uals(headerValue, header.getValue()); return headerName.equalsIgnoreCase(header.getName()) && Objects.equa ls(headerValue, header.getValue());
} }
return false; return false;
} }
@Override @Override
public void describeTo(final Description description) { public void describeTo(final Description description) {
description.appendText("same header as ").appendValue(headerValue).appen dText(": ").appendValue(headerValue); description.appendText("same header as ").appendValue(headerValue).appen dText(": ").appendValue(headerValue);
} }
public static Matcher<Header> same(final String headerName, final Object hea derValue) { public static Matcher<Header> same(final String headerName, final Object hea derValue) {
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)