Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SuiteRemoveCondition unit test #488

Merged
merged 2 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ All notable changes to AET will be documented in this file.
- [PR-413](https://github.com/Cognifide/aet/pull/413) Added ability to show full page source when there has been no difference discovered ([#369](https://github.com/Cognifide/aet/issues/369))

- [PR-463](https://github.com/Cognifide/aet/pull/463) Removed dependency to Joda time library
- [PR-488](https://github.com/Cognifide/aet/pull/488) Fix SuiteRemoveCondition unit test

## Version 3.2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public void evaluate_whenOnlyOneSuite_expectFalseNoMatterConditions(String allSu
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertFalse(remove);
}

Expand All @@ -80,10 +80,10 @@ public void evaluate_when8SuitesVersionsRemoveOldVersions_expectTrue(String allS
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertTrue(remove);
}

Expand All @@ -106,10 +106,10 @@ public void evaluate_when8SuitesVersionsKeepLastVersions_expectFalse(String allS
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertFalse(remove);
}

Expand All @@ -134,10 +134,10 @@ public void evaluate_when8SuitesRemoveOlderThanButAlwaysKeepLatestVersion_expect
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertTrue(remove);
}

Expand All @@ -153,10 +153,10 @@ public void evaluate_when8SuitesKeepNewerThan_expectFalse(String allSuitesVersio
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertFalse(remove);
}

Expand All @@ -172,10 +172,10 @@ public void evaluate_when8SuitesKeepNewerThanAndAtLeastXVersions_expectTrue(
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertTrue(remove);
}

Expand All @@ -191,10 +191,10 @@ public void evaluate_when8SuitesKeepNewerThanAndAtLeastXVersions_expectFalse(
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertFalse(remove);
}

Expand All @@ -206,10 +206,10 @@ public void evaluate_whenDuplicatedVersion_expectRemoveOnlyOldVersions(String al
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertTrue(remove);
}

Expand All @@ -222,10 +222,10 @@ public void evaluate_whenDuplicatedVersion_expectKeepNewestVersion(String allSui
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));
final boolean remove = condition
.evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
final boolean remove = condition.evaluate(suite);
assertFalse(remove);
}

Expand Down