@VisibleForTesting
  void parseWorkflowParameter(
      Map<String, Parameter> workflowParams, Parameter param, String workflowId) {
    parseWorkflowParameter(workflowParams, param, workflowId, new HashSet<>());
  }
@Test
  public void testParseWorkflowParameterWithImplicitToLong() {
    LongParameter bar = LongParameter.builder().name("bar").expression("foo + 1;").build();
    paramEvaluator.parseWorkflowParameter(
        Collections.singletonMap("foo", StringParameter.builder().expression("1+2+3;").build()),
        bar,
        "test-workflow");
    assertEquals(61, (long) bar.getEvaluatedResult());
    assertEquals(
        "Implicitly converted the evaluated result to a long for type String",
        bar.getMeta().get("warn"));

    bar = LongParameter.builder().name("bar").expression("foo + 1;").build();
    paramEvaluator.parseWorkflowParameter(
        Collections.singletonMap(
            "foo", StringParameter.builder().evaluatedResult("100").evaluatedTime(123L).build()),
        bar,
        "test-workflow");
    assertEquals(1001, (long) bar.getEvaluatedResult());
    assertEquals(
        "Implicitly converted the evaluated result to a long for type String",
        bar.getMeta().get("warn"));

    AssertHelper.assertThrows(
        "Can only cast string to long",
        IllegalArgumentException.class,
        "Param [bar] is expected to be a Long compatible type but is [class java.lang.Double]",
        () ->
            paramEvaluator.parseWorkflowParameter(
                Collections.emptyMap(),
                LongParameter.builder().name("bar").expression("0.01;").build(),
                "test-workflow"));

    AssertHelper.assertThrows(
        "Can only cast valid string to long",
        NumberFormatException.class,
        "For input string: \"foo\"",
        () ->
            paramEvaluator.parseWorkflowParameter(
                Collections.emptyMap(),
                LongParameter.builder().name("bar").expression("'foo';").build(),
                "test-workflow"));
  }