@Test
  public void testExecute_complex()
      throws IOException, InterruptedException, VerificationException, DigestException {
    String targetImage = dockerHost + ":5000/compleximage:maven" + System.nanoTime();
    Instant before = Instant.now();
    String output = buildAndRunComplex(targetImage, "pom-complex.xml");
    assertThat(output)
        .isEqualTo(
            "Hello, world. An argument.\n1970-01-01T00:00:01Z\nrwxr-xr-x\nrwxrwxrwx\nfoo\ncat\n"
                + "1970-01-01T00:00:01Z\n1970-01-01T00:00:01Z\n"
                + "-Xms512m\n-Xdebug\nenvvalue1\nenvvalue2\n");
    String digest =
        readDigestFile(
            simpleTestProject.getProjectRoot().resolve("target/different-jib-image.digest"));
    String id =
        readDigestFile(simpleTestProject.getProjectRoot().resolve("different-jib-image.id"));
    assertThat(id).isNotEqualTo(digest);
    assertThat(new Command("docker", "run", "--rm", id).run()).isEqualTo(output);

    assertThat(getCreationTime(targetImage)).isGreaterThan(before);
    assertThat(getWorkingDirectory(targetImage)).isEqualTo("/");
    assertThat(getEntrypoint(targetImage))
        .isEqualTo(
            "[java -Xms512m -Xdebug -cp /other:/app/resources:/app/classes:/app/libs/* "
                + "com.test.HelloWorld]");
  }
Pulls a built image and attempts to run it. Also verifies the container configuration and
history of the built image.

@param imageReference the image reference of the built image
@return the container output
@throws IOException if an I/O exception occurs
@throws InterruptedException if the process was interrupted
jib-maven-plugin/src/integration-test/java/com/google/cloud/tools/jib/maven/BuildImageMojoIntegrationTest.java