Search in sources :

Example 61 with StringRevision

use of com.thoughtworks.go.domain.materials.mercurial.StringRevision in project gocd by gocd.

the class TfsSDKCommandTest method shouldReturnChangeSetsFromAPreviouslyKnownRevisionUptilTheLatest.

@Test
public void shouldReturnChangeSetsFromAPreviouslyKnownRevisionUptilTheLatest() throws Exception {
    Changeset[] changeSets = getChangeSets(42);
    when(client.queryHistory(eq(TFS_PROJECT), any(ChangesetVersionSpec.class), anyInt())).thenReturn(changeSets);
    TfsSDKCommand spy = spy(tfsCommand);
    doReturn(null).when(spy).getModifiedFiles(changeSets[0]);
    List<Modification> modifications = spy.modificationsSince(null, new StringRevision("2"));
    assertThat(modifications.isEmpty(), is(false));
    verify(client, times(2)).queryHistory(eq(TFS_PROJECT), any(ChangesetVersionSpec.class), anyInt());
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) ChangesetVersionSpec(com.microsoft.tfs.core.clients.versioncontrol.specs.version.ChangesetVersionSpec) StringRevision(com.thoughtworks.go.domain.materials.mercurial.StringRevision) Changeset(com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset) Test(org.junit.Test)

Aggregations

StringRevision (com.thoughtworks.go.domain.materials.mercurial.StringRevision)61 Test (org.junit.Test)57 File (java.io.File)30 Modification (com.thoughtworks.go.domain.materials.Modification)16 RevisionContext (com.thoughtworks.go.domain.materials.RevisionContext)16 GitSubmoduleRepos (com.thoughtworks.go.helper.GitSubmoduleRepos)11 StringContains.containsString (org.hamcrest.core.StringContains.containsString)8 GitTestRepo (com.thoughtworks.go.domain.materials.git.GitTestRepo)7 TestSubprocessExecutionContext (com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext)5 InMemoryStreamConsumer (com.thoughtworks.go.util.command.InMemoryStreamConsumer)5 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 RegexMatcher (com.thoughtworks.go.matchers.RegexMatcher)4 ModifiedFile (com.thoughtworks.go.domain.materials.ModifiedFile)3 JsonValue (com.thoughtworks.go.util.JsonValue)3 ArrayList (java.util.ArrayList)3 Changeset (com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset)2 ChangesetVersionSpec (com.microsoft.tfs.core.clients.versioncontrol.specs.version.ChangesetVersionSpec)2 DependencyMaterialRevision (com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision)2 SysOutStreamConsumer (com.thoughtworks.go.mail.SysOutStreamConsumer)2 CommandLineException (com.thoughtworks.go.util.command.CommandLineException)2