@@ -0,0 +1,1826 @@
+package jenkins.plugins.git;%0A%0Aimport hudson.model.Item;%0Aimport hudson.model.TopLevelItem;%0Aimport hudson.plugins.git.GitStatus;%0Aimport jenkins.scm.api.SCMSource;%0Aimport jenkins.scm.api.SCMSourceOwner;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.jvnet.hudson.test.JenkinsRule;%0A%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport java.io.IOException;%0Aimport java.util.Collections;%0A%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * @author Robin M%C3%BCller%0A */%0Apublic class GitSCMSourceTest %7B%0A%0A    public static final String REMOTE = %22git@remote:test/project.git%22;%0A%0A    @Rule%0A    public JenkinsRule jenkins = new JenkinsRule();%0A%0A    private GitStatus gitStatus;%0A%0A    @Before%0A    public void setup() %7B%0A        gitStatus = new GitStatus();%0A    %7D%0A%0A    @Test%0A    public void testSourceOwnerTriggeredByDoNotifyCommit() throws ServletException, IOException %7B%0A        GitSCMSource gitSCMSource = new GitSCMSource(%22id%22, REMOTE, %22%22, %22*%22, %22%22, false);%0A        GitSCMSourceOwner scmSourceOwner = setupGitSCMSourceOwner(gitSCMSource);%0A        jenkins.getInstance().add(scmSourceOwner, %22gitSourceOwner%22);%0A%0A        gitStatus.doNotifyCommit(mock(HttpServletRequest.class), REMOTE, %22master%22, %22%22);%0A%0A        verify(scmSourceOwner).onSCMSourceUpdated(gitSCMSource);%0A    %7D%0A%0A    private GitSCMSourceOwner setupGitSCMSourceOwner(GitSCMSource gitSCMSource) %7B%0A        GitSCMSourceOwner owner = mock(GitSCMSourceOwner.class);%0A        when(owner.getSCMSources()).thenReturn(Collections.%3CSCMSource%3EsingletonList(gitSCMSource));%0A        when(owner.hasPermission(Item.READ)).thenReturn(true);%0A        return owner;%0A    %7D%0A%0A    private interface GitSCMSourceOwner extends TopLevelItem, SCMSourceOwner %7B%7D%0A%7D%0A

Add test of GitStatus.Listener onNotifyCommit method