"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient5/src/test/java/org/apache/hc/client5/http/NameValuePairMatcher.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.

NameValuePairMatcher.java  (httpcomponents-client-5.2-src):NameValuePairMatcher.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.NameValuePair; import org.apache.hc.core5.http.NameValuePair;
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 NameValuePairMatcher extends BaseMatcher<NameValuePair> { public class NameValuePairMatcher extends BaseMatcher<NameValuePair> {
private final String name; private final String name;
private final String value; private final String value;
public NameValuePairMatcher(final String name, final String value) { public NameValuePairMatcher(final String name, final String value) {
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
@Override @Override
public boolean matches(final Object item) { public boolean matches(final Object item) {
if (item instanceof NameValuePair) { if (item instanceof NameValuePair) {
final NameValuePair nvp = (NameValuePair) item; final NameValuePair nvp = (NameValuePair) item;
return LangUtils.equals(nvp.getName(), name) && LangUtils.equals(nvp .getValue(), value); return Objects.equals(nvp.getName(), name) && Objects.equals(nvp.get Value(), value);
} }
return false; return false;
} }
@Override @Override
public void describeTo(final Description description) { public void describeTo(final Description description) {
description.appendText("equals ").appendValue(name).appendText("=").appe ndValue(value); description.appendText("equals ").appendValue(name).appendText("=").appe ndValue(value);
} }
public static Matcher<NameValuePair> equals(final String name, final String value) { public static Matcher<NameValuePair> equals(final String name, final String value) {
 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)