Search in sources :

Example 1 with SaaSVolumeSource

use of com.netflix.titus.api.jobmanager.model.job.volume.SaaSVolumeSource in project titus-control-plane by Netflix.

the class JobModelSanitizationTest method testJobWithInvalidVolume.

@Test
public void testJobWithInvalidVolume() {
    VolumeSource vs = new SaaSVolumeSource("BAD_SAAS_NAME");
    Volume badVolume = Volume.newBuilder().withName("BAD_NAME").withVolumeSource(vs).build();
    JobDescriptor<BatchJobExt> badJobDescriptor = oneTaskBatchJobDescriptor().but(jd -> jd.toBuilder().withVolumes(Collections.singletonList(badVolume)).build());
    Set<ValidationError> violations = entitySanitizer.validate(badJobDescriptor);
    assertThat(violations).hasSize(2);
}
Also used : SaaSVolumeSource(com.netflix.titus.api.jobmanager.model.job.volume.SaaSVolumeSource) VolumeSource(com.netflix.titus.api.jobmanager.model.job.volume.VolumeSource) SaaSVolumeSource(com.netflix.titus.api.jobmanager.model.job.volume.SaaSVolumeSource) Volume(com.netflix.titus.api.jobmanager.model.job.volume.Volume) BatchJobExt(com.netflix.titus.api.jobmanager.model.job.ext.BatchJobExt) ValidationError(com.netflix.titus.common.model.sanitizer.ValidationError) Test(org.junit.Test)

Aggregations

BatchJobExt (com.netflix.titus.api.jobmanager.model.job.ext.BatchJobExt)1 SaaSVolumeSource (com.netflix.titus.api.jobmanager.model.job.volume.SaaSVolumeSource)1 Volume (com.netflix.titus.api.jobmanager.model.job.volume.Volume)1 VolumeSource (com.netflix.titus.api.jobmanager.model.job.volume.VolumeSource)1 ValidationError (com.netflix.titus.common.model.sanitizer.ValidationError)1 Test (org.junit.Test)1