package com.atlassian.stash.internal.scm.git.protocol.http;

import com.atlassian.stash.internal.scm.git.protocol.RepositoryPath;

import java.util.Optional;

import static org.junit.Assert.assertEquals;

public class PathInfoTestUtils {
    public static void assertPathInfo(String path, Optional<RepositoryPath> repositoryAddress,
                                      String postRepositoryAddressPath, boolean isReceivePack, boolean isUploadPack, boolean isDumb) {
        PathInfo pathInfo = PathInfo.of(path);
        assertEquals(repositoryAddress, pathInfo.getRepositoryPath());
        assertEquals(postRepositoryAddressPath, pathInfo.getRelativePath());
        assertEquals(isReceivePack, pathInfo.isReceive());
        assertEquals(isUploadPack, pathInfo.isUpload());
        assertEquals(isDumb, pathInfo.isDumb());
    }
}
