public String createRetrievalToken() throws IOException {
        File retrievalToken =
                new File(
                        resource.baseDirectory,
                        "retrieval_token_" + UUID.randomUUID().toString() + ".json");
        if (retrievalToken.createNewFile()) {
            final DataOutputStream dos = new DataOutputStream(new FileOutputStream(retrievalToken));
            dos.writeBytes("{\"manifest\": {}}");
            dos.flush();
            dos.close();
            return retrievalToken.getAbsolutePath();
        } else {
            throw new IOException(
                    "Could not create the RetrievalToken file: "
                            + retrievalToken.getAbsolutePath());
        }
    }
@Test
    void testCreateRetrievalToken() throws Exception {
        PythonDependencyInfo dependencyInfo =
                new PythonDependencyInfo(new HashMap<>(), null, null, new HashMap<>(), "python");
        Map<String, String> sysEnv = new HashMap<>();
        sysEnv.put("FLINK_HOME", "/flink");

        try (ProcessPythonEnvironmentManager environmentManager =
                new ProcessPythonEnvironmentManager(
                        dependencyInfo, new String[] {tmpDir}, sysEnv, new JobID())) {
            environmentManager.open();
            String retrievalToken = environmentManager.createRetrievalToken();

            File retrievalTokenFile = new File(retrievalToken);
            byte[] content = new byte[(int) retrievalTokenFile.length()];
            try (DataInputStream input = new DataInputStream(new FileInputStream(retrievalToken))) {
                input.readFully(content);
            }
            assertThat(new String(content)).isEqualTo("{\"manifest\": {}}");
        }
    }