@VisibleForTesting
  void secureSnapshot(Snapshot providedSnapshot, FileIO fileIO) throws UncheckedIOException {
    secureDataFile(providedSnapshot.addedDataFiles(fileIO));
    secureDeleteFile(providedSnapshot.addedDeleteFiles(fileIO));
    secureManifestFile(providedSnapshot.allManifests(fileIO));
  }
@Test
  void testSecureSnapshot() throws IOException {
    // The default file attribute that sets the permission as 777 when a file is created.
    FileAttribute<Set<PosixFilePermission>> attr =
        PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxrwxrwx"));

    // Mock DataFile and ManifestFile
    Snapshot mockSnapshot = Mockito.mock(org.apache.iceberg.Snapshot.class);
    Path tempFile1 = Files.createFile(tempDir.resolve("data1.parquet"), attr);
    Path tempFile2 = Files.createFile(tempDir.resolve("data2.parquet"), attr);
    Path tempFile3 = Files.createFile(tempDir.resolve("manifest"), attr);

    // Mock FileIO
    FileIO fileIO = Mockito.mock(org.apache.iceberg.io.FileIO.class);

    List<DataFile> dataFileList =
        ImmutableList.of(
            createDataFile(tempFile1.toString()), createDataFile(tempFile2.toString()));

    ManifestWriter<DataFile> manifestWriter =
        ManifestFiles.write(
            PartitionSpec.unpartitioned(),
            HadoopOutputFile.fromLocation(tempFile3.toString(), new Configuration()));
    manifestWriter.close();

    Mockito.when(mockSnapshot.allManifests(fileIO))
        .thenReturn(ImmutableList.of(manifestWriter.toManifestFile()));
    Mockito.when(mockSnapshot.addedDataFiles(fileIO)).thenReturn(dataFileList);
    snapshotInspector.secureSnapshot(mockSnapshot, fileIO);

    /* Verify the perms of files are modified as com.linkedin.openhouse.internal.catalog.MockApplication.perm does */
    FileSystem fileSystem = FileSystem.get(new Configuration());
    Assertions.assertEquals(
        fileSystem
            .getFileStatus(new org.apache.hadoop.fs.Path(tempFile1.toString()))
            .getPermission(),
        MockApplication.perm);
    Assertions.assertEquals(
        fileSystem
            .getFileStatus(new org.apache.hadoop.fs.Path(tempFile2.toString()))
            .getPermission(),
        MockApplication.perm);
    Assertions.assertEquals(
        fileSystem
            .getFileStatus(new org.apache.hadoop.fs.Path(tempFile3.toString()))
            .getPermission(),
        MockApplication.perm);
  }