Search in sources :

Example 1 with PipelineRepository

use of com.thoughtworks.go.server.persistence.PipelineRepository in project gocd by gocd.

the class PipelineTimelineTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    now = new DateTime();
    pipelineRepository = mock(PipelineRepository.class);
    materials = Arrays.asList("first", "second", "third", "fourth");
    first = PipelineMaterialModificationMother.modification(1, materials, Arrays.asList(now, now.plusMinutes(1), now.plusMinutes(2), now.plusMinutes(3)), 1, "111", "pipeline");
    second = PipelineMaterialModificationMother.modification(2, materials, Arrays.asList(now, now.plusMinutes(2), now.plusMinutes(1), now.plusMinutes(2)), 2, "222", "pipeline");
    third = PipelineMaterialModificationMother.modification(3, materials, Arrays.asList(now, now.plusMinutes(2), now.plusMinutes(1), now.plusMinutes(3)), 3, "333", "pipeline");
    fourth = PipelineMaterialModificationMother.modification(4, materials, Arrays.asList(now, now.plusMinutes(2), now.plusMinutes(3), now.plusMinutes(2)), 4, "444", "pipeline");
    pipelineName = "pipeline";
    transactionTemplate = mock(TransactionTemplate.class);
    transactionSynchronizationManager = mock(TransactionSynchronizationManager.class);
}
Also used : TransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TransactionSynchronizationManager) PipelineRepository(com.thoughtworks.go.server.persistence.PipelineRepository) TransactionTemplate(com.thoughtworks.go.server.transaction.TransactionTemplate) DateTime(org.joda.time.DateTime) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with PipelineRepository

use of com.thoughtworks.go.server.persistence.PipelineRepository in project gocd by gocd.

the class GoConfigServiceTest method setup.

@BeforeEach
public void setup() throws Exception {
    new SystemEnvironment().setProperty(SystemEnvironment.ENFORCE_SERVER_IMMUTABILITY, "N");
    configRepo = mock(ConfigRepository.class);
    goConfigDao = mock(GoConfigDao.class);
    pipelineRepository = mock(PipelineRepository.class);
    systemEnvironment = mock(SystemEnvironment.class);
    cruiseConfig = unchangedConfig();
    expectLoad(cruiseConfig);
    this.clock = mock(Clock.class);
    goCache = mock(GoCache.class);
    instanceFactory = mock(InstanceFactory.class);
    ConfigElementImplementationRegistry registry = ConfigElementImplementationRegistryMother.withNoPlugins();
    goConfigService = new GoConfigService(goConfigDao, this.clock, new GoConfigMigration(new TimeProvider(), registry), goCache, configRepo, registry, instanceFactory, mock(CachedGoPartials.class), systemEnvironment);
}
Also used : ConfigElementImplementationRegistry(com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry) ConfigRepository(com.thoughtworks.go.service.ConfigRepository) PipelineRepository(com.thoughtworks.go.server.persistence.PipelineRepository) GoCache(com.thoughtworks.go.server.cache.GoCache) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with PipelineRepository

use of com.thoughtworks.go.server.persistence.PipelineRepository in project gocd by gocd.

the class PipelineSelectionsServiceTest method setup.

@BeforeEach
public void setup() throws Exception {
    new SystemEnvironment().setProperty(SystemEnvironment.ENFORCE_SERVER_IMMUTABILITY, "N");
    goConfigDao = mock(GoConfigDao.class);
    pipelineRepository = mock(PipelineRepository.class);
    CruiseConfig cruiseConfig = unchangedConfig();
    expectLoad(cruiseConfig);
    Clock clock = mock(Clock.class);
    when(clock.currentTime()).thenReturn(FIXED_DATE);
    userDao = mock(UserDao.class);
    goConfigService = mock(GoConfigService.class);
    pipelineSelectionsService = new PipelineSelectionsService(pipelineRepository, goConfigService, clock);
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) UserDao(com.thoughtworks.go.server.dao.UserDao) PipelineRepository(com.thoughtworks.go.server.persistence.PipelineRepository) Clock(com.thoughtworks.go.util.Clock) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PipelineRepository (com.thoughtworks.go.server.persistence.PipelineRepository)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 ConfigElementImplementationRegistry (com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry)1 GoCache (com.thoughtworks.go.server.cache.GoCache)1 UserDao (com.thoughtworks.go.server.dao.UserDao)1 TransactionSynchronizationManager (com.thoughtworks.go.server.transaction.TransactionSynchronizationManager)1 TransactionTemplate (com.thoughtworks.go.server.transaction.TransactionTemplate)1 ConfigRepository (com.thoughtworks.go.service.ConfigRepository)1 Clock (com.thoughtworks.go.util.Clock)1 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)1 DateTime (org.joda.time.DateTime)1