static void assertBuildSuccess(BuildResult buildResult, String taskName, String successMessage) {
    BuildTask classesTask = buildResult.task(":classes");
    BuildTask jibTask = buildResult.task(":" + taskName);

    Assert.assertNotNull(classesTask);
    Assert.assertEquals(TaskOutcome.SUCCESS, classesTask.getOutcome());
    Assert.assertNotNull(jibTask);
    Assert.assertEquals(TaskOutcome.SUCCESS, jibTask.getOutcome());
    MatcherAssert.assertThat(buildResult.getOutput(), CoreMatchers.containsString(successMessage));
  }
Asserts that the test project build output indicates a success.

@param buildResult the builds results of the project under test
@param taskName the name of the Jib task that was run
@param successMessage a Jib-specific success message to check for
jib-gradle-plugin/src/integration-test/java/com/google/cloud/tools/jib/gradle/JibRunHelper.java