public void validateAndMergeOutputParams(StepRuntimeSummary runtimeSummary) {
    Optional<String> externalJobId = extractExternalJobId(runtimeSummary);
    if (externalJobId.isPresent()) {
      Optional<OutputData> outputDataOpt =
          outputDataDao.getOutputDataForExternalJob(externalJobId.get(), ExternalJobType.TITUS);
      outputDataOpt.ifPresent(
          outputData -> {
            ParamsMergeHelper.mergeOutputDataParams(
                runtimeSummary.getParams(), outputData.getParams());
          });
    }
  }
@Test
  public void testValidOutputParamTypes() throws IOException {
    Map<String, Parameter> runtimeParams =
        loadObject("fixtures/outputdata/sample-output-data-params-defaults.json", paramMap);
    Map<String, Parameter> outputParams =
        loadObject("fixtures/outputdata/sample-output-data-params-updated.json", paramMap);
    outputData =
        new OutputData(
            ExternalJobType.TITUS,
            titusTaskId,
            "wfid",
            System.currentTimeMillis(),
            System.currentTimeMillis(),
            outputParams,
            new HashMap<>());
    setupOutputDataDao();
    runtimeSummary = runtimeSummaryBuilder().artifacts(artifacts).params(runtimeParams).build();
    outputDataManager.validateAndMergeOutputParams(runtimeSummary);
    long[] expectedLongArray = {4L, 5L, 6L};
    assertEquals("goodbye", runtimeSummary.getParams().get("str_param").asString());
    assertArrayEquals(
        expectedLongArray, runtimeSummary.getParams().get("long_array_param").asLongArray());
    assertEquals(51L, runtimeSummary.getParams().get("long_param").asLong().longValue());
    assertEquals("e", runtimeSummary.getParams().get("string_map_param").asStringMap().get("a"));
    assertEquals("f", runtimeSummary.getParams().get("string_map_param").asStringMap().get("b"));
    assertArrayEquals(
        new String[] {"p1", "p2", "p3"},
        (String[]) runtimeSummary.getParams().get("map_param").asMap().get("table_name"));
  }