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());
}
Aggregations