Search in sources :

Example 1 with BuildArtifacts

use of jetbrains.buildServer.serverSide.artifacts.BuildArtifacts in project teamcity-torrent-plugin by JetBrains.

the class ServerTorrentsSeederTest method announceBuildArtifactsTest.

public void announceBuildArtifactsTest() {
    Path path = Paths.get("tmp");
    Mockery m = new Mockery();
    BuildArtifacts buildArtifacts = m.mock(BuildArtifacts.class);
    ArtifactsCollector artifactsCollector = m.mock(ArtifactsCollector.class);
    ArtifactProcessor artifactProcessor = m.mock(ArtifactProcessor.class);
    UnusedTorrentFilesRemover unusedTorrentFilesRemover = m.mock(UnusedTorrentFilesRemover.class);
    List<BuildArtifact> artifactsCollectorResult = Collections.emptyList();
    m.checking(new Expectations() {

        {
            one(artifactProcessor).processArtifacts(with(artifactsCollectorResult));
            one(artifactsCollector).collectArtifacts(with(buildArtifacts));
            will(returnValue(artifactsCollectorResult));
            one(unusedTorrentFilesRemover).removeUnusedTorrents(with(artifactsCollectorResult), with(path));
        }
    });
    myTorrentsSeeder.announceBuildArtifacts(path, buildArtifacts, artifactsCollector, artifactProcessor, unusedTorrentFilesRemover);
    m.assertIsSatisfied();
}
Also used : Path(java.nio.file.Path) Expectations(org.jmock.Expectations) BuildArtifact(jetbrains.buildServer.serverSide.artifacts.BuildArtifact) BuildArtifacts(jetbrains.buildServer.serverSide.artifacts.BuildArtifacts) Mockery(org.jmock.Mockery)

Aggregations

Path (java.nio.file.Path)1 BuildArtifact (jetbrains.buildServer.serverSide.artifacts.BuildArtifact)1 BuildArtifacts (jetbrains.buildServer.serverSide.artifacts.BuildArtifacts)1 Expectations (org.jmock.Expectations)1 Mockery (org.jmock.Mockery)1