<commit_before>package hudson.plugins.git.browser;

import hudson.model.*;
import hudson.plugins.git.*;
import hudson.plugins.git.extensions.GitSCMExtension;
import hudson.scm.ChangeLogSet;
import hudson.scm.EditType;
import org.jenkinsci.plugins.gitclient.JGitTool;
import org.junit.Test;

import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TFS2013GitRepositoryBrowserTest {

    private static final String projectName = "fisheyeProjectName";

    private final String repoUrl;
    private final GitChangeSetSample sample;

    public TFS2013GitRepositoryBrowserTest() {
        this.repoUrl = "http://tfs/tfs/project/_git/repo";
        sample = new GitChangeSetSample(false);

        GitSCM scm = new GitSCM(
                Collections.singletonList(new UserRemoteConfig(repoUrl, null, null, null)),
                new ArrayList<>(),
                null, JGitTool.MAGIC_EXENAME,
                Collections.<GitSCMExtension>emptyList());
        
        AbstractProject project = mock(AbstractProject.class);
        AbstractBuild build = mock(AbstractBuild.class);
        
        when(project.getScm()).thenReturn(scm);
        when(build.getProject()).thenReturn(project);

        sample.changeSet.setParent(ChangeLogSet.createEmpty((Run) build));
    }

    @Test
    public void testResolveURLFromSCM() throws Exception {
        TFS2013GitRepositoryBrowser browser = new TFS2013GitRepositoryBrowser("");
        assertThat(browser.getRepoUrl(sample.changeSet).toString(), is("http://tfs/tfs/project/_git/repo/"));
    }
<commit_msg>Fix TFS Browser tests<commit_after>package hudson.plugins.git.browser;

import hudson.model.*;
import hudson.plugins.git.*;
import hudson.plugins.git.extensions.GitSCMExtension;
import hudson.scm.ChangeLogSet;
import hudson.scm.EditType;
import org.jenkinsci.plugins.gitclient.JGitTool;
import org.junit.BeforeClass;
import org.junit.Test;

import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TFS2013GitRepositoryBrowserTest {

    private static final String repoUrl = "http://tfs/tfs/project/_git/repo";
    private static final GitChangeSetSample sample = new GitChangeSetSample(false);
    
    @BeforeClass
    public static void testSetUp() {

        GitSCM scm = new GitSCM(
            Collections.singletonList(new UserRemoteConfig(repoUrl, null, null, null)),
            new ArrayList<>(),
            null, JGitTool.MAGIC_EXENAME,
            Collections.<GitSCMExtension>emptyList());

        AbstractProject project = mock(AbstractProject.class);
        AbstractBuild build = mock(AbstractBuild.class);

        when(project.getScm()).thenReturn(scm);
        when(build.getProject()).thenReturn(project);

        sample.changeSet.setParent(ChangeLogSet.createEmpty((Run) build));
    }

    @Test
    public void testResolveURLFromSCM() throws Exception {
        TFS2013GitRepositoryBrowser browser = new TFS2013GitRepositoryBrowser("");
        assertThat(browser.getRepoUrl(sample.changeSet).toString(), is("http://tfs/tfs/project/_git/repo/"));
    }

{'fraction_non_alphanumeric': 0.10557432432432433, 'fraction_numerical': 0.007882882882882882, 'mean_word_length': 3.8804945054945055, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1921522', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1022, 'n_words': 196}