Search in sources :

Example 1 with MaterialService

use of com.thoughtworks.go.server.service.MaterialService in project gocd by gocd.

the class ConfigMaterialUpdaterTest method SetUp.

@Before
public void SetUp() {
    repoConfigDataSource = mock(GoRepoConfigDataSource.class);
    materialChecker = mock(MaterialChecker.class);
    materialRepository = mock(MaterialRepository.class);
    configCompleted = mock(ConfigMaterialUpdateCompletedTopic.class);
    topic = mock(MaterialUpdateCompletedTopic.class);
    materialService = mock(MaterialService.class);
    material = new SvnMaterial("url", "tom", "pass", false);
    when(materialRepository.folderFor(material)).thenReturn(folder);
    poller = mock(MaterialPoller.class);
    when(materialService.getPollerImplementation(any(Material.class))).thenReturn(poller);
    Modification svnModification = new Modification("user", "commend", "em@il", new Date(), "1");
    mods = revisions(material, svnModification);
    when(materialRepository.findLatestModification(material)).thenReturn(mods);
    configUpdater = new ConfigMaterialUpdater(repoConfigDataSource, materialRepository, materialChecker, configCompleted, topic, materialService, new TestSubprocessExecutionContext());
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Material(com.thoughtworks.go.domain.materials.Material) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Date(java.util.Date) GoRepoConfigDataSource(com.thoughtworks.go.config.GoRepoConfigDataSource) MaterialService(com.thoughtworks.go.server.service.MaterialService) MaterialPoller(com.thoughtworks.go.server.service.materials.MaterialPoller) TestSubprocessExecutionContext(com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext) MaterialRepository(com.thoughtworks.go.server.persistence.MaterialRepository) Before(org.junit.Before)

Example 2 with MaterialService

use of com.thoughtworks.go.server.service.MaterialService in project gocd by gocd.

the class MaterialDatabaseUpdaterIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    dbHelper.onSetUp();
    testRepo = new GitTestRepo();
    MaterialService slowMaterialService = new MaterialServiceWhichSlowsDownFirstTimeModificationCheck(materialRepository, goConfigService, securityService, packageRepositoryExtension, scmExtension);
    LegacyMaterialChecker materialChecker = new LegacyMaterialChecker(slowMaterialService, subprocessExecutionContext);
    ScmMaterialUpdater scmMaterialUpdater = new ScmMaterialUpdater(materialRepository, materialChecker, subprocessExecutionContext, slowMaterialService);
    transactionTemplateWithInvocationCount = new TransactionTemplateWithInvocationCount(transactionTemplate);
    updater = new MaterialDatabaseUpdater(materialRepository, serverHealthService, transactionTemplateWithInvocationCount, dependencyMaterialUpdater, scmMaterialUpdater, packageMaterialUpdater, pluggableSCMMaterialUpdater, materialExpansionService);
}
Also used : MaterialService(com.thoughtworks.go.server.service.MaterialService) GitTestRepo(com.thoughtworks.go.domain.materials.git.GitTestRepo) Before(org.junit.Before)

Example 3 with MaterialService

use of com.thoughtworks.go.server.service.MaterialService in project gocd by gocd.

the class LegacyMaterialCheckerTest method setUp.

@Before
public void setUp() {
    materialService = mock(MaterialService.class);
    checker = new LegacyMaterialChecker(materialService, null);
    file = new File(".");
}
Also used : MaterialService(com.thoughtworks.go.server.service.MaterialService) File(java.io.File) Before(org.junit.Before)

Aggregations

MaterialService (com.thoughtworks.go.server.service.MaterialService)3 Before (org.junit.Before)3 GoRepoConfigDataSource (com.thoughtworks.go.config.GoRepoConfigDataSource)1 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)1 Material (com.thoughtworks.go.domain.materials.Material)1 Modification (com.thoughtworks.go.domain.materials.Modification)1 TestSubprocessExecutionContext (com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext)1 GitTestRepo (com.thoughtworks.go.domain.materials.git.GitTestRepo)1 MaterialRepository (com.thoughtworks.go.server.persistence.MaterialRepository)1 MaterialPoller (com.thoughtworks.go.server.service.materials.MaterialPoller)1 File (java.io.File)1 Date (java.util.Date)1