Search in sources :

Example 1 with JobInstanceSqlMapDao

use of com.thoughtworks.go.server.dao.JobInstanceSqlMapDao in project gocd by gocd.

the class ElasticAgentPluginServiceTest method setUp.

@BeforeEach
void setUp() throws Exception {
    ArrayList<PluginDescriptor> plugins = new ArrayList<>();
    plugins.add(GoPluginDescriptor.builder().id("p1").isBundledPlugin(true).build());
    plugins.add(GoPluginDescriptor.builder().id("p2").isBundledPlugin(true).build());
    plugins.add(GoPluginDescriptor.builder().id("docker").isBundledPlugin(true).build());
    when(registry.getPlugins()).thenReturn(plugins);
    when(registry.has("docker")).thenReturn(true);
    when(registry.has("p1")).thenReturn(true);
    when(registry.has("p2")).thenReturn(true);
    when(registry.has("missing")).thenReturn(false);
    when(agentService.allElasticAgents()).thenReturn(new LinkedMultiValueMap<>());
    elasticAgentMetadataStore = ElasticAgentMetadataStore.instance();
    timeProvider = new TimeProvider();
    jobInstanceSqlMapDao = mock(JobInstanceSqlMapDao.class);
    service = new ElasticAgentPluginService(pluginManager, registry, agentService, environmentConfigService, createAgentQueue, serverPingQueue, goConfigService, timeProvider, serverHealthService, elasticAgentMetadataStore, clusterProfilesService, jobInstanceSqlMapDao, scheduleService, consoleService, ephemeralAutoRegisterKeyService, secretParamResolver, jobStatusTopic);
    when(goConfigService.serverConfig()).thenReturn(GoConfigMother.configWithAutoRegisterKey(autoRegisterKey).server());
}
Also used : GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) TimeProvider(com.thoughtworks.go.util.TimeProvider) ArrayList(java.util.ArrayList) JobInstanceSqlMapDao(com.thoughtworks.go.server.dao.JobInstanceSqlMapDao) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PluginDescriptor (com.thoughtworks.go.plugin.api.info.PluginDescriptor)1 GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)1 JobInstanceSqlMapDao (com.thoughtworks.go.server.dao.JobInstanceSqlMapDao)1 TimeProvider (com.thoughtworks.go.util.TimeProvider)1 ArrayList (java.util.ArrayList)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1