Search in sources :

Example 1 with ElasticAgentExtension

use of com.thoughtworks.go.plugin.access.elastic.ElasticAgentExtension in project gocd by gocd.

the class ElasticProfileServiceTest method setUp.

@BeforeEach
void setUp() throws Exception {
    pluginId = "cd.go.elastic.ecs";
    clusterProfileId = "prod-cluster";
    elasticAgentExtension = mock(ElasticAgentExtension.class);
    EntityHashingService hashingService = mock(EntityHashingService.class);
    goConfigService = mock(GoConfigService.class);
    secretParamResolver = mock(SecretParamResolver.class);
    elasticProfileService = new ElasticProfileService(goConfigService, hashingService, elasticAgentExtension, secretParamResolver);
    validator = mock(ElasticAgentProfileConfigurationValidator.class);
    elasticProfileService.setProfileConfigurationValidator(validator);
    ElasticConfig elasticConfig = new ElasticConfig();
    elasticConfig.getClusterProfiles().add(new ClusterProfile(clusterProfileId, pluginId));
    when(goConfigService.getElasticConfig()).thenReturn(elasticConfig);
    BasicCruiseConfig cruiseConfig = new BasicCruiseConfig();
    cruiseConfig.setElasticConfig(elasticConfig);
    when(goConfigService.getConfigForEditing()).thenReturn(cruiseConfig);
}
Also used : ElasticAgentProfileConfigurationValidator(com.thoughtworks.go.server.service.plugins.validators.elastic.ElasticAgentProfileConfigurationValidator) ElasticConfig(com.thoughtworks.go.config.elastic.ElasticConfig) ElasticAgentExtension(com.thoughtworks.go.plugin.access.elastic.ElasticAgentExtension) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) ClusterProfile(com.thoughtworks.go.config.elastic.ClusterProfile) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BasicCruiseConfig (com.thoughtworks.go.config.BasicCruiseConfig)1 ClusterProfile (com.thoughtworks.go.config.elastic.ClusterProfile)1 ElasticConfig (com.thoughtworks.go.config.elastic.ElasticConfig)1 ElasticAgentExtension (com.thoughtworks.go.plugin.access.elastic.ElasticAgentExtension)1 ElasticAgentProfileConfigurationValidator (com.thoughtworks.go.server.service.plugins.validators.elastic.ElasticAgentProfileConfigurationValidator)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1