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

com.github.dreamhead.moco.matcher.AndRequestMatcher Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
package com.github.dreamhead.moco.matcher;

import com.github.dreamhead.moco.Request;
import com.github.dreamhead.moco.RequestMatcher;

public class AndRequestMatcher extends CompositeRequestMatcher {
    public AndRequestMatcher(final Iterable matchers) {
        super(matchers);
    }

    @Override
    protected boolean doMatch(final Request request, final Iterable matchers) {
        for (RequestMatcher matcher : matchers) {
            if (!matcher.match(request)) {
                return false;
            }
        }

        return true;
    }

    @Override
    protected RequestMatcher newMatcher(final Iterable matchers) {
        return new AndRequestMatcher(matchers);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy