@TestWith({ "A-1,A-2,B-2 ; null ; 1 ; A-2 ; 10", "A-1,A-2,B-2 ; null ; 1 ; B-2 ; 10" }) public void evaluate_whenDuplicatedVersion_expectKeepNewestVersion(String allSuitesVersions, Long removeOlderThan, Long keepNVersions, String evaluatedSuite, Integer createdDaysAgo) { final List<Suite> suites = SUITES_LIST_COERCER.toList(allSuitesVersions); Suite suite = mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo); SuiteRemoveCondition condition = new SuiteRemoveCondition(suites, mockRemoveConditions(removeOlderThan, keepNVersions), new SystemLocalDateTime()); final boolean remove = condition.evaluate(suite); assertFalse(remove); }
public boolean evaluate(final Suite suite) { boolean remove = false; if (minKeepVersion != null) { remove = suite.getVersion() < minKeepVersion; } if (removeTimestamp != null) { final long suiteCreated = suite.getRunTimestamp().get(); remove &= suiteCreated <= removeTimestamp; } return remove; }
SuiteRemoveCondition { public boolean evaluate(final Suite suite) { boolean remove = false; if (minKeepVersion != null) { remove = suite.getVersion() < minKeepVersion; } if (removeTimestamp != null) { final long suiteCreated = suite.getRunTimestamp().get(); remove &= suiteCreated <= removeTimestamp; } return remove; } }
SuiteRemoveCondition { public boolean evaluate(final Suite suite) { boolean remove = false; if (minKeepVersion != null) { remove = suite.getVersion() < minKeepVersion; } if (removeTimestamp != null) { final long suiteCreated = suite.getRunTimestamp().get(); remove &= suiteCreated <= removeTimestamp; } return remove; } SuiteRemoveCondition(final Collection<Suite> suiteRunVersions,
      final CleanerContext cleanerContext, LocalDateTimeProvider dateTimeProvider); }
SuiteRemoveCondition { public boolean evaluate(final Suite suite) { boolean remove = false; if (minKeepVersion != null) { remove = suite.getVersion() < minKeepVersion; } if (removeTimestamp != null) { final long suiteCreated = suite.getRunTimestamp().get(); remove &= suiteCreated <= removeTimestamp; } return remove; } SuiteRemoveCondition(final Collection<Suite> suiteRunVersions,
      final CleanerContext cleanerContext, LocalDateTimeProvider dateTimeProvider); boolean evaluate(final Suite suite); }
SuiteRemoveCondition { public boolean evaluate(final Suite suite) { boolean remove = false; if (minKeepVersion != null) { remove = suite.getVersion() < minKeepVersion; } if (removeTimestamp != null) { final long suiteCreated = suite.getRunTimestamp().get(); remove &= suiteCreated <= removeTimestamp; } return remove; } SuiteRemoveCondition(final Collection<Suite> suiteRunVersions,
      final CleanerContext cleanerContext, LocalDateTimeProvider dateTimeProvider); boolean evaluate(final Suite suite);  }