@Test
public void testLegacyBatchJobDisruptionBudgetRewrite() {

    JobDescriptor<BatchJobExt> jobDescriptor = newBatchJob().getValue().toBuilder()
            .withDisruptionBudget(DisruptionBudget.none())
            .build();
    ExtendedJobSanitizer sanitizer = new ExtendedJobSanitizer(configuration, jobAssertions, entitySanitizer, disruptionBudgetSanitizer, jd -> false, jd -> false, titusRuntime);
    Optional<JobDescriptor<BatchJobExt>> sanitizedOpt = sanitizer.sanitize(jobDescriptor);
    assertThat(sanitizedOpt).isNotEmpty();
    JobDescriptor<BatchJobExt> sanitized = sanitizedOpt.get();
    String nonCompliant = sanitized.getAttributes().get(TITUS_NON_COMPLIANT_FEATURES);
    assertThat(nonCompliant).contains(JobFeatureComplianceChecks.DISRUPTION_BUDGET_FEATURE);
    SelfManagedDisruptionBudgetPolicy policy = (SelfManagedDisruptionBudgetPolicy) sanitized.getDisruptionBudget().getDisruptionBudgetPolicy();
    assertThat(policy.getRelocationTimeMs()).isEqualTo(
            (long) ((jobDescriptor.getExtensions()).getRuntimeLimitMs() * BATCH_RUNTIME_LIMIT_FACTOR)
    );
}