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 PathMatcher implements ConditionMatcher {
    @Override
    public boolean matches(MockCondition condition, MockRequest request, Map<String, String> pathVariables) {
        return condition.getValue().equals(pathVariables.get(condition.getKey()));
    }

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


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