private Path setUpWarProject(Path webAppDirectory) throws IOException {
    File warOutputDir = temporaryFolder.newFolder("output");
    zipUpDirectory(webAppDirectory, warOutputDir.toPath().resolve("my-app.war"));

    project.getPlugins().apply("war");
    War war = project.getTasks().withType(War.class).getByName("war");
    war.getDestinationDirectory().set(warOutputDir);

    // Make "GradleProjectProperties" 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-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesTest.java