From: Martin Stockhammer Date: Fri, 30 Aug 2019 21:07:09 +0000 (+0200) Subject: Relaxing precision for date comparison in unit test X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9bb3c0d4ced88c689da66f6e759ebc14ef2a2ee6;p=archiva.git Relaxing precision for date comparison in unit test --- diff --git a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java index 89ddd63ce..8b27d5241 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java +++ b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java @@ -126,7 +126,7 @@ public class NewArtifactsRssFeedProcessorTest assertTrue( feed.getDescription().equals( "New artifacts found in repository 'test-repo' during repository scan." ) ); assertTrue( feed.getLanguage().equals( "en-us" ) ); - assertTrue( feed.getPublishedDate().toInstant().equals( whenGathered.toInstant() ) ); + assertTrue( feed.getPublishedDate().toInstant().truncatedTo( ChronoUnit.MILLIS ).equals( whenGathered.toInstant().truncatedTo( ChronoUnit.MILLIS ) ) ); List entries = feed.getEntries(); assertEquals( entries.size(), 1 );