private static String verifyTaskSuccess(TestProject project, @Nullable String moduleName) {
    String taskName =
        ":" + (moduleName == null ? "" : moduleName + ":") + JibPlugin.SKAFFOLD_FILES_TASK_V2_NAME;
    BuildResult buildResult = project.build(taskName, "-q", "-D_TARGET_IMAGE=ignored");
    BuildTask jibTask = buildResult.task(taskName);
    Assert.assertNotNull(jibTask);
    Assert.assertEquals(TaskOutcome.SUCCESS, jibTask.getOutcome());
    String output = buildResult.getOutput().trim();
    MatcherAssert.assertThat(output, CoreMatchers.startsWith("BEGIN JIB JSON"));

    // Return task output with header removed
    return output.replace("BEGIN JIB JSON", "").trim();
  }
Verifies that the files task succeeded and returns the list of paths it prints out.

@param project the project to run the task on
@param moduleName the name of the sub-project, or {@code null} if no sub-project
@return the JSON string printed by the task
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/skaffold/FilesTaskV2Test.java