Search in sources :

Example 1 with ConfigurationEntryDoc

use of com.epam.pipeline.elasticsearchagent.model.ConfigurationEntryDoc in project cloud-pipeline by epam.

the class ConfigurationMapperTest method shouldMapFireCloudConfiguration.

@Test
void shouldMapFireCloudConfiguration() throws IOException {
    ConfigurationEntryMapper mapper = new ConfigurationEntryMapper();
    RunConfiguration runConfiguration = buildRunConfiguration();
    FirecloudRunConfigurationEntry entry = new FirecloudRunConfigurationEntry();
    entry.setName(TEST_NAME);
    entry.setMethodName(TEST_NAME);
    entry.setMethodSnapshot(TEST_SNAPSHOT);
    entry.setMethodConfigurationName(TEST_NAME);
    entry.setMethodConfigurationSnapshot(TEST_SNAPSHOT);
    ConfigurationEntryDoc configuration = buildDoc(null, runConfiguration, entry);
    XContentBuilder contentBuilder = mapper.map(buildContainer(configuration));
    verifyFirecloudConfigurationEntry(entry, contentBuilder);
    verifyRunConfiguration(runConfiguration, TEST_NAME + " ", contentBuilder);
    verifyPipelineUser(USER, contentBuilder);
    verifyPermissions(PERMISSIONS_CONTAINER, contentBuilder);
    verifyMetadata(EXPECTED_METADATA, contentBuilder);
}
Also used : FirecloudRunConfigurationEntry(com.epam.pipeline.entity.configuration.FirecloudRunConfigurationEntry) MapperVerificationUtils.verifyRunConfiguration(com.epam.pipeline.elasticsearchagent.MapperVerificationUtils.verifyRunConfiguration) RunConfiguration(com.epam.pipeline.entity.configuration.RunConfiguration) ConfigurationEntryDoc(com.epam.pipeline.elasticsearchagent.model.ConfigurationEntryDoc) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) Test(org.junit.jupiter.api.Test)

Example 2 with ConfigurationEntryDoc

use of com.epam.pipeline.elasticsearchagent.model.ConfigurationEntryDoc in project cloud-pipeline by epam.

the class ConfigurationMapperTest method shouldMapRunConfiguration.

@Test
void shouldMapRunConfiguration() throws IOException {
    ConfigurationEntryMapper mapper = new ConfigurationEntryMapper();
    Pipeline pipeline = buildPipeline();
    RunConfiguration runConfiguration = buildRunConfiguration();
    PipelineConfiguration pipelineConfiguration = new PipelineConfiguration();
    pipelineConfiguration.setDockerImage(TEST_PATH);
    RunConfigurationEntry entry = new RunConfigurationEntry();
    entry.setPipelineVersion(TEST_VERSION);
    entry.setName(TEST_NAME);
    entry.setConfiguration(pipelineConfiguration);
    ConfigurationEntryDoc configuration = buildDoc(pipeline, runConfiguration, entry);
    XContentBuilder contentBuilder = mapper.map(buildContainer(configuration));
    verifyRunConfiguration(runConfiguration, TEST_NAME + " ", contentBuilder);
    verifyRunConfigurationEntry(entry, pipeline, contentBuilder);
    verifyPipelineUser(USER, contentBuilder);
    verifyPermissions(PERMISSIONS_CONTAINER, contentBuilder);
    verifyMetadata(EXPECTED_METADATA, contentBuilder);
}
Also used : MapperVerificationUtils.verifyRunConfiguration(com.epam.pipeline.elasticsearchagent.MapperVerificationUtils.verifyRunConfiguration) RunConfiguration(com.epam.pipeline.entity.configuration.RunConfiguration) PipelineConfiguration(com.epam.pipeline.entity.configuration.PipelineConfiguration) AbstractRunConfigurationEntry(com.epam.pipeline.entity.configuration.AbstractRunConfigurationEntry) RunConfigurationEntry(com.epam.pipeline.entity.configuration.RunConfigurationEntry) MapperVerificationUtils.verifyRunConfigurationEntry(com.epam.pipeline.elasticsearchagent.MapperVerificationUtils.verifyRunConfigurationEntry) FirecloudRunConfigurationEntry(com.epam.pipeline.entity.configuration.FirecloudRunConfigurationEntry) ConfigurationEntryDoc(com.epam.pipeline.elasticsearchagent.model.ConfigurationEntryDoc) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) Pipeline(com.epam.pipeline.entity.pipeline.Pipeline) Test(org.junit.jupiter.api.Test)

Aggregations

MapperVerificationUtils.verifyRunConfiguration (com.epam.pipeline.elasticsearchagent.MapperVerificationUtils.verifyRunConfiguration)2 ConfigurationEntryDoc (com.epam.pipeline.elasticsearchagent.model.ConfigurationEntryDoc)2 FirecloudRunConfigurationEntry (com.epam.pipeline.entity.configuration.FirecloudRunConfigurationEntry)2 RunConfiguration (com.epam.pipeline.entity.configuration.RunConfiguration)2 XContentBuilder (org.elasticsearch.common.xcontent.XContentBuilder)2 Test (org.junit.jupiter.api.Test)2 MapperVerificationUtils.verifyRunConfigurationEntry (com.epam.pipeline.elasticsearchagent.MapperVerificationUtils.verifyRunConfigurationEntry)1 AbstractRunConfigurationEntry (com.epam.pipeline.entity.configuration.AbstractRunConfigurationEntry)1 PipelineConfiguration (com.epam.pipeline.entity.configuration.PipelineConfiguration)1 RunConfigurationEntry (com.epam.pipeline.entity.configuration.RunConfigurationEntry)1 Pipeline (com.epam.pipeline.entity.pipeline.Pipeline)1