Search in sources :

Example 1 with Changeset

use of com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset 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)

Example 2 with Changeset

use of com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset in project gocd by gocd.

the class TfsSDKCommandTest method getChangeSets.

private Changeset[] getChangeSets(int changeSetID) {
    Changeset oneChangeSet = new Changeset("owner", "comment", null, null);
    oneChangeSet.setChangesetID(changeSetID);
    return new Changeset[] { oneChangeSet };
}
Also used : Changeset(com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset)

Example 3 with Changeset

use of com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset in project gocd by gocd.

the class TfsSDKCommandTest method getChangeSets.

private Changeset[] getChangeSets(int changeSetID) {
    Changeset oneChangeSet = new Changeset("owner", "comment", null, null);
    oneChangeSet.setChangesetID(changeSetID);
    return new Changeset[] { oneChangeSet };
}
Also used : Changeset(com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset)

Example 4 with Changeset

use of com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset in project gocd by gocd.

the class TfsSDKCommandTest method shouldReturnChangeSetsFromAPreviouslyKnownRevisionUptilTheLatest.

@Test
void shouldReturnChangeSetsFromAPreviouslyKnownRevisionUptilTheLatest() {
    Changeset[] changeSets = getChangeSets(42);
    when(client.queryHistory(eq(TFS_PROJECT), or(isNull(), 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()).isFalse();
    verify(client, times(2)).queryHistory(eq(TFS_PROJECT), or(isNull(), any(ChangesetVersionSpec.class)), anyInt());
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) StringRevision(com.thoughtworks.go.domain.materials.mercurial.StringRevision) Changeset(com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset) Test(org.junit.jupiter.api.Test)

Aggregations

Changeset (com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Changeset)4 Modification (com.thoughtworks.go.domain.materials.Modification)2 StringRevision (com.thoughtworks.go.domain.materials.mercurial.StringRevision)2 ChangesetVersionSpec (com.microsoft.tfs.core.clients.versioncontrol.specs.version.ChangesetVersionSpec)1 Test (org.junit.Test)1 Test (org.junit.jupiter.api.Test)1