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