private Path setUpWar(Path explodedWar) throws IOException {
    Path fakeMavenBuildDirectory = temporaryFolder.getRoot().toPath();
    when(mockBuild.getDirectory()).thenReturn(fakeMavenBuildDirectory.toString());
    when(mockBuild.getFinalName()).thenReturn("final-name");
    when(mockMavenProject.getPackaging()).thenReturn("war");

    zipUpDirectory(explodedWar, fakeMavenBuildDirectory.resolve("final-name.war"));

    // Make "MavenProjectProperties" use this folder to explode the WAR into.
    Path unzipTarget = temporaryFolder.newFolder("exploded").toPath();
    when(mockTempDirectoryProvider.newDirectory()).thenReturn(unzipTarget);
    return unzipTarget;
  }
Helper for reading back layers in a {@link BuildContext}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesTest.java