public Result fetchArtifacts(String[] uris) {
        checkArgument(uris != null && uris.length > 0, "At least one URI is required.");

        ArtifactUtils.createMissingParents(baseDir);
        List<File> artifacts =
                Arrays.stream(uris)
                        .map(FunctionUtils.uncheckedFunction(this::fetchArtifact))
                        .collect(Collectors.toList());

        if (artifacts.size() > 1) {
            return new Result(null, artifacts);
        }

        if (artifacts.size() == 1) {
            return new Result(artifacts.get(0), null);
        }

        // Should not happen.
        throw new IllegalStateException("Corrupt artifact fetching state.");
    }
@Test
    void testHttpFetch() throws Exception {
        configuration.set(ArtifactFetchOptions.RAW_HTTP_ENABLED, true);
        HttpServer httpServer = null;
        try {
            httpServer = startHttpServer();
            File sourceFile = getFlinkClientsJar();
            httpServer.createContext(
                    "/download/" + sourceFile.getName(), new DummyHttpDownloadHandler(sourceFile));
            String uriStr =
                    String.format(
                            "http://127.0.0.1:%d/download/" + sourceFile.getName(),
                            httpServer.getAddress().getPort());

            ArtifactFetchManager fetchMgr = new ArtifactFetchManager(configuration);
            ArtifactFetchManager.Result res = fetchMgr.fetchArtifacts(new String[] {uriStr});
            assertThat(res.getJobJar()).isNotNull();
            assertThat(res.getArtifacts()).isNull();
            assertFetchedFile(res.getJobJar(), sourceFile);
        } finally {
            if (httpServer != null) {
                httpServer.stop(0);
            }
        }
    }