All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lyncode.testy.http.matchers.HttpHeaderMatcherBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
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