@Test
  public void testGetJarArtifact_originalJarCopiedIfSpringBoot() throws IOException {
    temporaryFolder.newFile("helloworld-1.jar.original");
    when(mockBuild.getDirectory()).thenReturn(temporaryFolder.getRoot().toString());
    when(mockBuild.getFinalName()).thenReturn("helloworld-1");

    setUpSpringBootFatJar();
    Path tempDirectory = temporaryFolder.newFolder("tmp").toPath();
    when(mockTempDirectoryProvider.newDirectory()).thenReturn(tempDirectory);

    assertThat(mavenProjectProperties.getJarArtifact())
        .isEqualTo(tempDirectory.resolve("helloworld-1.original.jar"));

    mavenProjectProperties.waitForLoggingThread();
    verify(mockLog).info("Spring Boot repackaging (fat JAR) detected; using the original JAR");
  }
Helper for reading back layers in a {@link BuildContext}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesTest.java