Skip to content

Commit

Permalink
Do not assert anything about the backup file, since that timestamp is…
Browse files Browse the repository at this point in the history
… OS dependent
  • Loading branch information
Ekryd committed Feb 2, 2020
1 parent 773d130 commit a916995
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion maven-plugin/src/it/keep-timestamp/postbuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ assert log.text.contains('keepTimestamp = true')

timestamp = timestampFile.getText('UTF-8') as Long
assert sorted.lastModified() == timestamp
assert backup.lastModified() > timestamp
// Do not assert anything about the backup file, since that timestamp is OS dependent

return true
5 changes: 2 additions & 3 deletions sorter/src/test/java/sortpom/util/TestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,10 @@ void performSortThatTestsTimestamps() throws Exception {

if (pluginParameters.keepTimestamp) {
assertThat(testpom.lastModified(), is(pomTimestamp));
// The backup file should not be modified
assertThat(backupFile.lastModified(), greaterThan(pomTimestamp));
// Do not assert anything about the backup file, since that timestamp is OS dependent
} else {
assertThat(testpom.lastModified(), greaterThan(pomTimestamp));
assertThat(backupFile.lastModified(), greaterThan(pomTimestamp));
// Do not assert anything about the backup file, since that timestamp is OS dependent
}
} finally {
cleanupAfterTest();
Expand Down

0 comments on commit a916995

Please sign in to comment.