diff --git a/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java b/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java index b374ebdfb5637..39efba2244aab 100644 --- a/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java +++ b/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java @@ -1650,7 +1650,7 @@ private boolean containsSnapshotFile( } private boolean containsFile(List filesMetadata, StoreFileMetadata storeFileMetadata) { - return filesMetadata.stream().anyMatch(f -> f.isSame(storeFileMetadata)); + return filesMetadata.stream().anyMatch(f -> f.name().equals(storeFileMetadata.name()) && f.isSame(storeFileMetadata)); } private boolean containsFile(List files, String fileName, long length) {