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