private static List<String> getJsons(TestProject project) {
    BuildResult buildResult =
        project.build(JibPlugin.SKAFFOLD_INIT_TASK_NAME, "-q", "-D_TARGET_IMAGE=testimage");
    BuildTask jibTask = buildResult.task(":" + JibPlugin.SKAFFOLD_INIT_TASK_NAME);
    Assert.assertNotNull(jibTask);
    Assert.assertEquals(TaskOutcome.SUCCESS, jibTask.getOutcome());
    String output = buildResult.getOutput().trim();
    MatcherAssert.assertThat(output, CoreMatchers.startsWith("BEGIN JIB JSON"));

    Pattern pattern = Pattern.compile("BEGIN JIB JSON\r?\n(\\{.*})");
    Matcher matcher = pattern.matcher(output);
    List<String> jsons = new ArrayList<>();
    while (matcher.find()) {
      jsons.add(matcher.group(1));
    }

    // Return task output with header removed
    return jsons;
  }
Verifies that the files task succeeded and returns the list of JSON strings printed by the
task.

@param project the project to run the task on
@return the JSON strings printed by the task
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/skaffold/InitTaskTest.java