private static SkaffoldSyncMapTemplate generateTemplate(
      TestProject project, @Nullable String moduleName, @Nullable List<String> params)
      throws IOException {
    String taskName =
        ":" + (moduleName == null ? "" : moduleName + ":") + JibPlugin.SKAFFOLD_SYNC_MAP_TASK_NAME;
    List<String> buildParams = new ArrayList<>();
    buildParams.add(taskName);
    buildParams.add("-q");
    buildParams.add("-D_TARGET_IMAGE=ignored");
    buildParams.add("--stacktrace");
    if (params != null) {
      buildParams.addAll(params);
    }
    BuildResult buildResult = project.build(buildParams);
    BuildTask jibTask = buildResult.task(taskName);
    Assert.assertNotNull(jibTask);
    Assert.assertEquals(TaskOutcome.SUCCESS, jibTask.getOutcome());

    List<String> outputLines =
        Splitter.on(System.lineSeparator()).omitEmptyStrings().splitToList(buildResult.getOutput());
    Assert.assertEquals(2, outputLines.size());
    Assert.assertEquals("BEGIN JIB JSON: SYNCMAP/1", outputLines.get(0));
    return SkaffoldSyncMapTemplate.from(outputLines.get(1));
  }
Verifies that the sync map task succeeded and returns the parsed json.

@param project the project to run the task on
@param moduleName the name of the sub-project, or {@code null} if no sub-project
@param params extra gradle cli params to use during the build
@return the list of paths printed by the task
@throws IOException if the json parser fails
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/skaffold/SyncMapTaskTest.java