Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/6263#discussion_r201291704
--- Diff:
flink-clients/src/test/java/org/apache/flink/client/program/PackagedProgramTest.java
---
@@ -56,6 +63,54 @@ public void testGetPreviewPlan() {
}
}
+ /**
+ * The test for {@link PackagedProgram#extractContainedLibraries}.
+ * As a prerequisite the test generates a jar file with the following
structure
+ * test.jar
+ * |- lib
+ * |--|- internalTest.jar
+ */
+ @Test
+ public void testExtractContainedLibraries() {
+ String s = "testExtractContainedLibraries";
+ Path workDir = null;
+ Path fakeJar = null;
+ try {
+ workDir =
Files.createTempDirectory(PackagedProgram.class.getSimpleName() + "_");
+ fakeJar =
Paths.get(workDir.toAbsolutePath().toString(), "test.jar");
+ FileOutputStream fos = new
FileOutputStream(fakeJar.toFile());
+ try (ZipOutputStream zos = new ZipOutputStream(fos)) {
--- End diff --
inline `FileOutputStream` creation, i.e. `new ZipOutputStream(new
FileOutputStream(...))`
---