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

Code before:
  @Test
  public void testToJibContainerBuilder_basicInfo()
      throws IOException, URISyntaxException, InvalidImageReferenceException {
    Path standardJar = Paths.get(Resources.getResource(SIMPLE_STANDARD_JAR).toURI());
    Path destDir = temporaryFolder.getRoot().toPath();
    JibContainerBuilder containerBuilder = JarFiles.toJibContainerBuilder(standardJar, destDir);
    ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

    assertThat(buildPlan.getBaseImage()).isEqualTo("gcr.io/distroless/java");
    assertThat(buildPlan.getPlatforms()).isEqualTo(ImmutableSet.of(new Platform("amd64", "linux")));
    assertThat(buildPlan.getCreationTime()).isEqualTo(Instant.EPOCH);
    assertThat(buildPlan.getFormat()).isEqualTo(ImageFormat.Docker);
    assertThat(buildPlan.getEnvironment()).isEmpty();
    assertThat(buildPlan.getLabels()).isEmpty();
    assertThat(buildPlan.getVolumes()).isEmpty();
    assertThat(buildPlan.getExposedPorts()).isEmpty();
    assertThat(buildPlan.getUser()).isNull();
    assertThat(buildPlan.getWorkingDirectory()).isNull();
    assertThat(buildPlan.getEntrypoint())
        .isEqualTo(
            ImmutableList.of("java", "-cp", "/app/explodedJar:/app/dependencies/*", "HelloWorld"));
    assertThat(((FileEntriesLayer) buildPlan.getLayers().get(0)).getEntries())
        .isEqualTo(
            FileEntriesLayer.builder()
                .addEntry(
                    standardJar.getParent().resolve(Paths.get("dependency1")),
                    AbsoluteUnixPath.get("/app/dependencies/dependency1"))
                .build()
                .getEntries());
    assertThat(((FileEntriesLayer) buildPlan.getLayers().get(1)).getEntries())
        .containsExactlyElementsIn(
            FileEntriesLayer.builder()
                .addEntry(
                    destDir.resolve("META-INF/"),
                    AbsoluteUnixPath.get("/app/explodedJar/META-INF/"))
                .addEntry(
                    destDir.resolve("META-INF/MANIFEST.MF"),
                    AbsoluteUnixPath.get("/app/explodedJar/META-INF/MANIFEST.MF"))
                .addEntry(
                    destDir.resolve("resource1.txt"),
                    AbsoluteUnixPath.get("/app/explodedJar/resource1.txt"))
                .addEntry(
                    destDir.resolve("directory1/"),
                    AbsoluteUnixPath.get("/app/explodedJar/directory1/"))
                .build()
                .getEntries());
    assertThat(((FileEntriesLayer) buildPlan.getLayers().get(2)).getEntries())
        .containsExactlyElementsIn(
            FileEntriesLayer.builder()
                .addEntry(
                    destDir.resolve("class1.class"),

Review comment (suggestion):
```suggestion
                    standardJar.getParent().resolve("dependency1"),
```

Code after:
  @Test
  public void testToJibContainerBuilder_basicInfo()
      throws IOException, URISyntaxException, InvalidImageReferenceException {
    Path standardJar = Paths.get(Resources.getResource(SIMPLE_STANDARD_JAR).toURI());
    Path destDir = temporaryFolder.getRoot().toPath();
    JibContainerBuilder containerBuilder = JarFiles.toJibContainerBuilder(standardJar, destDir);
    ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

    assertThat(buildPlan.getBaseImage()).isEqualTo("gcr.io/distroless/java");
    assertThat(buildPlan.getPlatforms()).isEqualTo(ImmutableSet.of(new Platform("amd64", "linux")));
    assertThat(buildPlan.getCreationTime()).isEqualTo(Instant.EPOCH);
    assertThat(buildPlan.getFormat()).isEqualTo(ImageFormat.Docker);
    assertThat(buildPlan.getEnvironment()).isEmpty();
    assertThat(buildPlan.getLabels()).isEmpty();
    assertThat(buildPlan.getVolumes()).isEmpty();
    assertThat(buildPlan.getExposedPorts()).isEmpty();
    assertThat(buildPlan.getUser()).isNull();
    assertThat(buildPlan.getWorkingDirectory()).isNull();
    assertThat(buildPlan.getEntrypoint())
        .isEqualTo(
            ImmutableList.of("java", "-cp", "/app/explodedJar:/app/dependencies/*", "HelloWorld"));
    assertThat(((FileEntriesLayer) buildPlan.getLayers().get(0)).getEntries())
        .isEqualTo(
            FileEntriesLayer.builder()
                .addEntry(
                    standardJar.getParent().resolve("dependency1"),
                    AbsoluteUnixPath.get("/app/dependencies/dependency1"))
                .build()
                .getEntries());
    assertThat(((FileEntriesLayer) buildPlan.getLayers().get(1)).getEntries())
        .containsExactlyElementsIn(
            FileEntriesLayer.builder()
                .addEntry(
                    destDir.resolve("META-INF/"),
                    AbsoluteUnixPath.get("/app/explodedJar/META-INF/"))
                .addEntry(
                    destDir.resolve("META-INF/MANIFEST.MF"),
                    AbsoluteUnixPath.get("/app/explodedJar/META-INF/MANIFEST.MF"))
                .addEntry(
                    destDir.resolve("resource1.txt"),
                    AbsoluteUnixPath.get("/app/explodedJar/resource1.txt"))
                .addEntry(
                    destDir.resolve("directory1/"),
                    AbsoluteUnixPath.get("/app/explodedJar/directory1/"))
                .build()
                .getEntries());
    assertThat(((FileEntriesLayer) buildPlan.getLayers().get(2)).getEntries())
        .containsExactlyElementsIn(
            FileEntriesLayer.builder()
                .addEntry(
                    destDir.resolve("class1.class"),