From 91b598cc6cad493b2858e0e6f2685b9aceb6c6b6 Mon Sep 17 00:00:00 2001 From: Esta Nagy Date: Sat, 21 Sep 2024 11:53:03 +0200 Subject: [PATCH] Fix: Fix invalid test assertion - Fixes an invalid assertion made for folder size comparison {patch} Signed-off-by: Esta Nagy --- .../restore/pipeline/RestoreControllerIntegrationTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/file-barj-core/src/test/java/com/github/nagyesta/filebarj/core/restore/pipeline/RestoreControllerIntegrationTest.java b/file-barj-core/src/test/java/com/github/nagyesta/filebarj/core/restore/pipeline/RestoreControllerIntegrationTest.java index bd0043c..e9dea08 100644 --- a/file-barj-core/src/test/java/com/github/nagyesta/filebarj/core/restore/pipeline/RestoreControllerIntegrationTest.java +++ b/file-barj-core/src/test/java/com/github/nagyesta/filebarj/core/restore/pipeline/RestoreControllerIntegrationTest.java @@ -716,8 +716,10 @@ private static void assertFileMetadataMatches( "File should have correct permissions: " + restoredFile); Assertions.assertEquals(expectedMetadata.getLastModifiedUtcEpochSeconds(), actualMetadata.getLastModifiedUtcEpochSeconds(), "File should have correct last modified time: " + restoredFile); - Assertions.assertEquals(expectedMetadata.getOriginalSizeBytes(), actualMetadata.getOriginalSizeBytes(), - "File should have correct size: " + restoredFile); + if (actualMetadata.getFileType().isContentSource()) { + Assertions.assertEquals(expectedMetadata.getOriginalSizeBytes(), actualMetadata.getOriginalSizeBytes(), + "File should have correct size: " + restoredFile); + } Assertions.assertEquals(expectedMetadata.getOriginalHash(), actualMetadata.getOriginalHash(), "File should have correct hash: " + restoredFile); }