static BuildResult buildToDockerDaemon(
      TestProject testProject, String imageReference, String gradleBuildFile)
      throws IOException, InterruptedException, DigestException {
    BuildResult buildResult =
        testProject.build(
            "clean",
            "jibDockerBuild",
            "-Djib.useOnlyProjectCache=true",
            "-Djib.console=plain",
            "-D_TARGET_IMAGE=" + imageReference,
            "-Djib.allowInsecureRegistries=" + imageReference.startsWith("localhost"),
            "-b=" + gradleBuildFile);
    assertBuildSuccess(buildResult, "jibDockerBuild", "Built image to Docker daemon as ");
    assertThatExpectedImageDigestAndIdReturned(testProject.getProjectRoot());
    MatcherAssert.assertThat(buildResult.getOutput(), CoreMatchers.containsString(imageReference));

    String history = new Command("docker", "history", imageReference).run();
    MatcherAssert.assertThat(history, CoreMatchers.containsString("jib-gradle-plugin"));

    return buildResult;
  }
Helper class to run integration tests.
jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/JibRunHelper.java