@Test
  public void testBuildTar_simple() throws IOException, InterruptedException {
    String targetImage = "simpleimage:gradle" + System.nanoTime();

    String outputPath =
        simpleTestProject
            .getProjectRoot()
            .resolve("build")
            .resolve("different-jib-image.tar")
            .toString();
    BuildResult buildResult =
        simpleTestProject.build(
            "clean",
            "jibBuildTar",
            "-Djib.useOnlyProjectCache=true",
            "-Djib.console=plain",
            "-D_TARGET_IMAGE=" + targetImage);

    JibRunHelper.assertBuildSuccess(buildResult, "jibBuildTar", "Built image tarball at ");
    assertThat(buildResult.getOutput()).contains(outputPath);

    new Command("docker", "load", "--input", outputPath).run();
    String output = new Command("docker", "run", "--rm", targetImage).run();

    assertThat(ImmutableList.copyOf(output.split("\n")))
        .containsExactly(
            "Hello, world. An argument.",
            "1970-01-01T00:00:01Z",
            "rw-r--r--",
            "rw-r--r--",
            "foo",
            "cat",
            "1970-01-01T00:00:01Z",
            "1970-01-01T00:00:01Z");
    assertDockerInspect(targetImage);
    assertThat(JibRunHelper.getCreationTime(targetImage)).isEqualTo(Instant.EPOCH);
    assertThat(getWorkingDirectory(targetImage)).isEqualTo("/home");
  }
Asserts that the test project has the required exposed ports, labels and volumes.

@param imageReference the image to test
@throws IOException if the {@code docker inspect} command fails to run
@throws InterruptedException if the {@code docker inspect} command is interrupted
jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/SingleProjectIntegrationTest.java