Repository: GoogleContainerTools/jib
File: jib-cli/src/test/java/com/google/cloud/tools/jib/cli/jar/JarProcessorTest.java (Java)

Code before:
        .containsExactly(
            AbsoluteUnixPath.get("/app/explodedJar/META-INF"),
            AbsoluteUnixPath.get("/app/explodedJar/META-INF/MANIFEST.MF"));

    // Validate classes layer.
    // TODO: Validate order of file paths once
    // https://github.com/GoogleContainerTools/jib/issues/2821 is fixed.
    List<AbsoluteUnixPath> actualClassesPath =
        classesLayer
            .getEntries()
            .stream()
            .map(FileEntry::getExtractionPath)
            .collect(Collectors.toList());
    assertThat(actualClassesPath)
        .containsExactly(
            AbsoluteUnixPath.get("/app/explodedJar/META-INF"),
            AbsoluteUnixPath.get("/app/explodedJar/class1.class"),
            AbsoluteUnixPath.get("/app/explodedJar/class2.class"));
  }

  @Test
  public void testExplodeMode_standard_computeEntrypoint_allLayersPresent()
      throws IOException, URISyntaxException {
    Path standardJar =
        Paths.get(Resources.getResource(STANDARD_JAR_WITH_CLASS_PATH_MANIFEST).toURI());
    Path destDir = temporaryFolder.newFolder().toPath();
    List<FileEntriesLayer> layers = JarProcessor.explodeStandardJar(standardJar, destDir);
    ImmutableList<String> actualEntrypoint =
        JarProcessor.computeEntrypoint_explodedStandard(standardJar, destDir, layers);

    assertThat(actualEntrypoint)
        .isEqualTo(
            ImmutableList.of("java", "-cp", "/app/dependencies:/app/explodedJar", "HelloWorld"));
  }

  @Test
  public void testExplodedMode_standard_computeEntrypoint_noDependenciesLayers()
      throws IOException, URISyntaxException {
    Path standardJar =
        Paths.get(Resources.getResource(STANDARD_JAR_WITHOUT_CLASS_PATH_MANIFEST).toURI());
    Path destDir = temporaryFolder.newFolder().toPath();
    List<FileEntriesLayer> layers = JarProcessor.explodeStandardJar(standardJar, destDir);
    ImmutableList<String> actualEntrypoint =
        JarProcessor.computeEntrypoint_explodedStandard(standardJar, destDir, layers);

    assertThat(actualEntrypoint)
        .isEqualTo(ImmutableList.of("java", "-cp", "/app/explodedJar", "HelloWorld"));
  }

  @Test
  public void testExplodedMode_standard_computeEntrypoint_noMainClass()

Review comment (suggestion):
Just so you know, if you don't need a nested directory or multiple directories, you can use the root: `temporaryFolder.getRoot().toPath()`.

Code after:
        .containsExactly(
            AbsoluteUnixPath.get("/app/explodedJar/META-INF"),
            AbsoluteUnixPath.get("/app/explodedJar/META-INF/MANIFEST.MF"));

    // Validate classes layer.
    // TODO: Validate order of file paths once
    // https://github.com/GoogleContainerTools/jib/issues/2821 is fixed.
    List<AbsoluteUnixPath> actualClassesPath =
        classesLayer
            .getEntries()
            .stream()
            .map(FileEntry::getExtractionPath)
            .collect(Collectors.toList());
    assertThat(actualClassesPath)
        .containsExactly(
            AbsoluteUnixPath.get("/app/explodedJar/META-INF"),
            AbsoluteUnixPath.get("/app/explodedJar/class1.class"),
            AbsoluteUnixPath.get("/app/explodedJar/class2.class"));
  }

  @Test
  public void testExplodeMode_standard_computeEntrypoint_allLayersPresent()
      throws IOException, URISyntaxException {
    Path standardJar =
        Paths.get(Resources.getResource(STANDARD_JAR_WITH_CLASS_PATH_MANIFEST).toURI());
    ImmutableList<String> actualEntrypoint =
        JarProcessor.computeEntrypointForExplodedStandard(standardJar);

    assertThat(actualEntrypoint)
        .isEqualTo(
            ImmutableList.of("java", "-cp", "/app/explodedJar:/app/dependencies/*", "HelloWorld"));
  }

  @Test
  public void testExplodedMode_standard_computeEntrypoint_noDependenciesLayers()
      throws IOException, URISyntaxException {
    Path standardJar =
        Paths.get(Resources.getResource(STANDARD_JAR_WITHOUT_CLASS_PATH_MANIFEST).toURI());
    ImmutableList<String> actualEntrypoint =
        JarProcessor.computeEntrypointForExplodedStandard(standardJar);

    assertThat(actualEntrypoint)
        .isEqualTo(
            ImmutableList.of("java", "-cp", "/app/explodedJar:/app/dependencies/*", "HelloWorld"));
  }

  @Test
  public void testExplodedMode_standard_computeEntrypoint_noMainClass() throws URISyntaxException {
    Path standardJar = Paths.get(Resources.getResource(STANDARD_JAR_EMPTY).toURI());
    IllegalArgumentException ex =
        assertThrows(