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

Code before:

    assertThat(snapshotLayer.getName()).isEqualTo("snapshot dependencies");
    assertThat(snapshotLayer.getEntries().get(0).getExtractionPath())
        .isEqualTo(AbsoluteUnixPath.get("/app/BOOT-INF/lib/dependency3-SNAPSHOT.jar"));

    assertThat(resourcesLayer.getName()).isEqualTo("resources");
    assertThat(resourcesLayer.getEntries().get(0).getExtractionPath())
        .isEqualTo(AbsoluteUnixPath.get("/app/META-INF/MANIFEST.MF"));

    assertThat(classesLayer.getName()).isEqualTo("classes");
    assertThat(
            classesLayer
                .getEntries()
                .stream()
                .map(FileEntry::getExtractionPath)
                .collect(Collectors.toList()))
        .containsExactly(
            AbsoluteUnixPath.get("/app/BOOT-INF/classes/class1.class"),
            AbsoluteUnixPath.get("/app/BOOT-INF/classes/classDirectory/class2.class"));
  }

  @Test
  public void testCreateLayersForPackagedSpringboot() throws IOException, URISyntaxException {
    Path springbootJar = Paths.get(Resources.getResource(SPRING_BOOT_JAR).toURI());
    List<FileEntriesLayer> layers =
        JarModeProcessor.createLayerForPackagedSpringBoot(springbootJar);

    assertThat(layers.size()).isEqualTo(1);

    FileEntriesLayer jarLayer = layers.get(0);

    assertThat(jarLayer.getName()).isEqualTo("jar");
    assertThat(jarLayer.getEntries().size()).isEqualTo(1);
    assertThat(jarLayer.getEntries().get(0).getExtractionPath())
        .isEqualTo(AbsoluteUnixPath.get("/app/springboot_sample.jar"));
  }
}


Review comment (suggestion):
```suggestion
        JarModeProcessor.createLayerForPackagedSpringBoot(springBootJar);
```

Code after:

    assertThat(snapshotLayer.getName()).isEqualTo("snapshot dependencies");
    assertThat(snapshotLayer.getEntries().get(0).getExtractionPath())
        .isEqualTo(AbsoluteUnixPath.get("/app/BOOT-INF/lib/dependency3-SNAPSHOT.jar"));

    assertThat(resourcesLayer.getName()).isEqualTo("resources");
    assertThat(resourcesLayer.getEntries().get(0).getExtractionPath())
        .isEqualTo(AbsoluteUnixPath.get("/app/META-INF/MANIFEST.MF"));

    assertThat(classesLayer.getName()).isEqualTo("classes");
    assertThat(
            classesLayer
                .getEntries()
                .stream()
                .map(FileEntry::getExtractionPath)
                .collect(Collectors.toList()))
        .containsExactly(
            AbsoluteUnixPath.get("/app/BOOT-INF/classes/class1.class"),
            AbsoluteUnixPath.get("/app/BOOT-INF/classes/classDirectory/class2.class"));
  }

  @Test
  public void testCreateLayersForPackagedSpringBoot() throws URISyntaxException {
    Path springBootJar = Paths.get(Resources.getResource(SPRING_BOOT_JAR).toURI());
    List<FileEntriesLayer> layers =
        JarModeProcessor.createLayerForPackagedSpringBoot(springBootJar);

    assertThat(layers.size()).isEqualTo(1);

    FileEntriesLayer jarLayer = layers.get(0);

    assertThat(jarLayer.getName()).isEqualTo("jar");
    assertThat(jarLayer.getEntries().size()).isEqualTo(1);
    assertThat(jarLayer.getEntries().get(0).getExtractionPath())
        .isEqualTo(AbsoluteUnixPath.get("/app/springboot_sample.jar"));
  }
}