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

com.github.dreamhead.moco.matcher.EqRequestMatcher 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.RequestExtractor;
import com.github.dreamhead.moco.RequestMatcher;
import com.github.dreamhead.moco.resource.Resource;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;

public class EqRequestMatcher extends AbstractOperatorMatcher {
    public EqRequestMatcher(final RequestExtractor extractor, final Resource expected) {
        super(extractor, expected, new Predicate() {
            @Override
            public boolean apply(final String input) {
                return input.equals(expected.readFor(Optional.absent()).toString());
            }
        });
    }

    @Override
    protected RequestMatcher newMatcher(final RequestExtractor extractor, final Resource resource) {
        return new EqRequestMatcher<>(extractor, resource);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy