com.lyncode.testy.http.matchers.HttpHeaderMatcherBuilder Maven / Gradle / Ivy
package com.lyncode.testy.http.matchers;
import com.lyncode.testy.matchers.AbstractMatcherBuilder;
import org.apache.http.Header;
import org.hamcrest.FeatureMatcher;
import org.hamcrest.Matcher;
public class HttpHeaderMatcherBuilder extends AbstractMatcherBuilder {
public HttpHeaderMatcherBuilder withName(Matcher matcher) {
return with(new FeatureMatcher(matcher, "name", "Header name") {
@Override
protected String featureValueOf(Header header) {
return header.getName();
}
});
}
public HttpHeaderMatcherBuilder withValue(Matcher matcher) {
return with(new FeatureMatcher(matcher, "value", "Header value") {
@Override
protected String featureValueOf(Header header) {
return header.getValue();
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy