@Test
  public void testBuild_complex()
      throws IOException, InterruptedException, DigestException, InvalidImageReferenceException {
    String targetImage = dockerHost + ":6000/compleximage:gradle" + System.nanoTime();
    Instant beforeBuild = Instant.now();
    String output = buildAndRunComplex(targetImage, "testuser", "testpassword", localRegistry2);

    String digest =
        readDigestFile(
            simpleTestProject.getProjectRoot().resolve("build/different-jib-image.digest"));
    String imageReferenceWithDigest =
        ImageReference.parse(targetImage).withQualifier(digest).toString();
    localRegistry2.pull(imageReferenceWithDigest);
    assertThat(new Command("docker", "run", "--rm", imageReferenceWithDigest).run())
        .isEqualTo(output);

    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(JibRunHelper.getCreationTime(targetImage)).isGreaterThan(beforeBuild);
    assertThat(getWorkingDirectory(targetImage)).isEqualTo("/");
  }
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