Search in sources :

Example 11 with RunConfigurationEntry

use of com.epam.pipeline.entity.configuration.RunConfigurationEntry in project cloud-pipeline by epam.

the class RunConfigurationProviderTest method validateShouldNotValidateInstanceTypeIfConfigurationInstanceTypeIsNotSpecified.

@Test
public void validateShouldNotValidateInstanceTypeIfConfigurationInstanceTypeIsNotSpecified() {
    final PipelineConfiguration pipelineConfiguration = new PipelineConfiguration();
    pipelineConfiguration.setInstanceType(null);
    final RunConfigurationEntry runConfigurationEntry = new RunConfigurationEntry();
    runConfigurationEntry.setConfiguration(pipelineConfiguration);
    runConfigurationProvider.validateEntry(runConfigurationEntry);
    verify(instanceOfferManager, times(0)).isToolInstanceAllowed(any(), any());
}
Also used : PipelineConfiguration(com.epam.pipeline.entity.configuration.PipelineConfiguration) RunConfigurationEntry(com.epam.pipeline.entity.configuration.RunConfigurationEntry) Test(org.junit.Test)

Example 12 with RunConfigurationEntry

use of com.epam.pipeline.entity.configuration.RunConfigurationEntry in project cloud-pipeline by epam.

the class RunConfigurationProviderTest method validateShouldValidateConfigurationInstanceType.

@Test
public void validateShouldValidateConfigurationInstanceType() {
    final PipelineConfiguration pipelineConfiguration = new PipelineConfiguration();
    pipelineConfiguration.setInstanceType(ALLOWED_INSTANCE_TYPE);
    final RunConfigurationEntry runConfigurationEntry = new RunConfigurationEntry();
    runConfigurationEntry.setConfiguration(pipelineConfiguration);
    runConfigurationProvider.validateEntry(runConfigurationEntry);
    verify(instanceOfferManager).isToolInstanceAllowed(eq(ALLOWED_INSTANCE_TYPE), any());
}
Also used : PipelineConfiguration(com.epam.pipeline.entity.configuration.PipelineConfiguration) RunConfigurationEntry(com.epam.pipeline.entity.configuration.RunConfigurationEntry) Test(org.junit.Test)

Example 13 with RunConfigurationEntry

use of com.epam.pipeline.entity.configuration.RunConfigurationEntry 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

RunConfigurationEntry (com.epam.pipeline.entity.configuration.RunConfigurationEntry)13 PipelineConfiguration (com.epam.pipeline.entity.configuration.PipelineConfiguration)10 Test (org.junit.Test)7 RunConfiguration (com.epam.pipeline.entity.configuration.RunConfiguration)6 FirecloudRunConfigurationEntry (com.epam.pipeline.entity.configuration.FirecloudRunConfigurationEntry)4 Pipeline (com.epam.pipeline.entity.pipeline.Pipeline)4 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)3 AbstractRunConfigurationEntry (com.epam.pipeline.entity.configuration.AbstractRunConfigurationEntry)3 Transactional (org.springframework.transaction.annotation.Transactional)3 Folder (com.epam.pipeline.entity.pipeline.Folder)2 Before (org.junit.Before)2 MessageConstants (com.epam.pipeline.common.MessageConstants)1 MessageHelper (com.epam.pipeline.common.MessageHelper)1 AwsRegionVO (com.epam.pipeline.controller.vo.AwsRegionVO)1 DataStorageVO (com.epam.pipeline.controller.vo.DataStorageVO)1 EntityVO (com.epam.pipeline.controller.vo.EntityVO)1 MetadataVO (com.epam.pipeline.controller.vo.MetadataVO)1 PipelineVO (com.epam.pipeline.controller.vo.PipelineVO)1 RunConfigurationVO (com.epam.pipeline.controller.vo.configuration.RunConfigurationVO)1 MetadataEntityVO (com.epam.pipeline.controller.vo.metadata.MetadataEntityVO)1