package com.atlassian.bitbucket.test.rest;

import org.hamcrest.Matcher;
import org.hamcrest.Matchers;

import javax.annotation.Nullable;
import java.util.Map;

/**
 * Matchers for maps returned by RestAssured that represent JSON ref objects (branches, tags).
 */
public class RefJsonMatchers {

    private RefJsonMatchers() {
        throw new UnsupportedOperationException(RefJsonMatchers.class.getName() + " should not be instantiated");
    }

    public static Matcher<Map<? extends String, ?>> hasId(@Nullable String refId) {
        return Matchers.<String, Object>hasEntry("id", refId);
    }

    public static Matcher<Map<? extends String, ?>> hasDisplayId(@Nullable String displayId) {
        return Matchers.<String, Object>hasEntry("displayId", displayId);
    }
}
