package com.eactive.httpmockserver.api.condition;

import com.eactive.httpmockserver.api.dto.MockRequest;
import com.eactive.httpmockserver.api.entity.MockCondition;
import org.springframework.stereotype.Component;

import java.util.Map;


@Component
public class QueryMatcher implements ConditionMatcher {
    @Override
    public boolean matches(MockCondition condition, MockRequest request, Map<String, String> pathVariables) {
        return condition.getValue().equals(request.getParam(condition.getKey()));
    }

    @Override
    public String getType() {
        return "query";
    }

    @Override
    public String getDisplayName() {
        return "Query";
    }
}
