use of com.thoughtworks.go.server.persistence.MaterialRepository 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());
}
use of com.thoughtworks.go.server.persistence.MaterialRepository in project gocd by gocd.
the class PipelineServiceTriangleDependencyTest method setUp.
@Before
public void setUp() throws Exception {
pipelineTimeline = mock(PipelineTimeline.class);
pipelineDao = mock(PipelineSqlMapDao.class);
materialRepository = mock(MaterialRepository.class);
TestTransactionSynchronizationManager mockTransactionSynchronizationManager = new TestTransactionSynchronizationManager();
TransactionTemplate mockTransactionTemplate = new TestTransactionTemplate(mockTransactionSynchronizationManager);
service = new PipelineService(pipelineDao, mock(StageService.class), mock(PipelineLockService.class), pipelineTimeline, materialRepository, mockTransactionTemplate, systemEnvironment, null, materialConfigConverter);
first = oneModifiedFile("1");
third = oneModifiedFile("3");
second = oneModifiedFile("2");
first.setId(1);
third.setId(3);
second.setId(2);
notifier.disableUpdates();
}
use of com.thoughtworks.go.server.persistence.MaterialRepository in project gocd by gocd.
the class MaterialCheckerTest method setUp.
@Before
public void setUp() throws Exception {
materialRepository = Mockito.mock(MaterialRepository.class);
tempFiles = new TempFiles();
mockMaterial = Mockito.mock(ScmMaterial.class);
materialChecker = new MaterialChecker(materialRepository);
workingFolder = tempFiles.createUniqueFolder("materialChecker");
}
use of com.thoughtworks.go.server.persistence.MaterialRepository in project gocd by gocd.
the class PipelineServiceTest method setUp.
@Before
public void setUp() throws Exception {
pipelineTimeline = mock(PipelineTimeline.class);
pipelineDao = mock(PipelineSqlMapDao.class);
materialRepository = mock(MaterialRepository.class);
TestTransactionSynchronizationManager mockTransactionSynchronizationManager = new TestTransactionSynchronizationManager();
TransactionTemplate mockTransactionTemplate = new TestTransactionTemplate(mockTransactionSynchronizationManager);
service = new PipelineService(pipelineDao, mock(StageService.class), mock(PipelineLockService.class), pipelineTimeline, materialRepository, mockTransactionTemplate, systemEnvironment, null, materialConfigConverter);
first = oneModifiedFile("1");
third = oneModifiedFile("3");
second = oneModifiedFile("2");
first.setId(1);
third.setId(3);
second.setId(2);
}
Aggregations