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

com.thoughtworks.webstub.stub.matcher.MethodMatcher Maven / Gradle / Ivy

The newest version!
package com.thoughtworks.webstub.stub.matcher;

import com.thoughtworks.webstub.config.HttpConfiguration;

import javax.servlet.http.HttpServletRequest;

import static javax.servlet.http.HttpServletResponse.SC_NOT_IMPLEMENTED;

public class MethodMatcher extends RequestPartMatcher {
    public MethodMatcher(HttpServletRequest request) {
        super(request, SC_NOT_IMPLEMENTED);
    }

    @Override
    public boolean matches(HttpConfiguration configuration) {
        return getMethod(configuration).equals(request.getMethod());
    }

    private String getMethod(HttpConfiguration configuration) {
        return configuration.request().method();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy