@VisibleForTesting
    List<Path> getShipArchives() {
        return shipArchives;
    }
@Test
    void testShipArchives() throws IOException {
        final File homeFolder =
                Files.createTempDirectory(temporaryFolder, UUID.randomUUID().toString()).toFile();
        File dir1 = new File(homeFolder.getPath(), "dir1");
        File file1 = new File(homeFolder.getPath(), "file1");
        File archive1 = new File(homeFolder.getPath(), "archive1.zip");
        File archive2 = new File(homeFolder.getPath(), "archive2.zip");
        assertThat(dir1.mkdirs()).isTrue();
        assertThat(file1.createNewFile()).isTrue();
        assertThat(archive1.createNewFile()).isTrue();
        assertThat(archive2.createNewFile()).isTrue();

        Configuration flinkConfiguration = new Configuration();
        flinkConfiguration.set(
                YarnConfigOptions.SHIP_ARCHIVES,
                Arrays.asList(dir1.getAbsolutePath(), archive1.getAbsolutePath()));
        assertThrows(
                "Directories or non-archive files are included.",
                IllegalArgumentException.class,
                () -> createYarnClusterDescriptor(flinkConfiguration));

        flinkConfiguration.set(
                YarnConfigOptions.SHIP_ARCHIVES,
                Arrays.asList(file1.getAbsolutePath(), archive1.getAbsolutePath()));
        assertThrows(
                "Directories or non-archive files are included.",
                IllegalArgumentException.class,
                () -> createYarnClusterDescriptor(flinkConfiguration));

        flinkConfiguration.set(
                YarnConfigOptions.SHIP_ARCHIVES,
                Arrays.asList(archive1.getAbsolutePath(), archive2.getAbsolutePath()));
        createYarnClusterDescriptor(flinkConfiguration);

        String archive3 = "hdfs:///flink/archive3.zip";
        final org.apache.hadoop.conf.Configuration hdConf =
                new org.apache.hadoop.conf.Configuration();
        hdConf.set(
                MiniDFSCluster.HDFS_MINIDFS_BASEDIR, temporaryFolder.toAbsolutePath().toString());
        try (final MiniDFSCluster hdfsCluster = new MiniDFSCluster.Builder(hdConf).build()) {
            final org.apache.hadoop.fs.Path hdfsRootPath =
                    new org.apache.hadoop.fs.Path(hdfsCluster.getURI());
            hdfsCluster.getFileSystem().createNewFile(new org.apache.hadoop.fs.Path(archive3));

            flinkConfiguration.set(
                    YarnConfigOptions.SHIP_ARCHIVES,
                    Arrays.asList(archive1.getAbsolutePath(), archive3));
            final YarnConfiguration yarnConfig = new YarnConfiguration();
            yarnConfig.set(
                    CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, hdfsRootPath.toString());

            YarnClusterDescriptor descriptor =
                    createYarnClusterDescriptor(flinkConfiguration, yarnConfig);
            assertThat(descriptor.getShipArchives())
                    .containsExactly(getPathFromLocalFile(archive1), new Path(archive3));
        }
    }