@Test
  public void testGetJarArtifact_originalJarIfSpringBoot_differentClassifier() throws IOException {
    Path buildDirectory = temporaryFolder.newFolder("target").toPath();
    Files.createFile(buildDirectory.resolve("helloworld-1.jar"));
    when(mockMavenProject.getBasedir()).thenReturn(temporaryFolder.getRoot());
    when(mockBuild.getDirectory()).thenReturn(buildDirectory.toString());
    when(mockBuild.getFinalName()).thenReturn("helloworld-1");

    when(mockMavenProject.getPlugin("org.apache.maven.plugins:maven-jar-plugin"))
        .thenReturn(mockPlugin);
    when(mockPlugin.getExecutions()).thenReturn(Arrays.asList(mockPluginExecution));
    when(mockPluginExecution.getId()).thenReturn("default-jar");
    when(mockPluginExecution.getConfiguration()).thenReturn(pluginConfiguration);
    addXpp3DomChild(pluginConfiguration, "outputDirectory", "target");

    Xpp3Dom bootPluginConfiguration = setUpSpringBootFatJar();
    addXpp3DomChild(bootPluginConfiguration, "classifier", "boot-class");

    assertThat(mavenProjectProperties.getJarArtifact())
        .isEqualTo(buildDirectory.resolve("helloworld-1.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