public Map<String, Parameter> getAllParams(
      Step stepDefinition, WorkflowSummary workflowSummary, StepRuntimeSummary runtimeSummary) {
    return paramsManager.generateMergedStepParams(
        workflowSummary, stepDefinition, getStepRuntime(stepDefinition.getType()), runtimeSummary);
  }
@Test
  public void testMergeNestedParamMap() {
    when(this.defaultParamManager.getDefaultStepParams())
        .thenReturn(
            ImmutableMap.of(
                "nested-default-new",
                MapParamDefinition.builder()
                    .name("nested-default-new")
                    .value(
                        singletonMap(
                            "default-new",
                            ParamDefinition.buildParamDefinition("default-new", "from-default")))
                    .build(),
                "nested-common",
                MapParamDefinition.builder()
                    .name("nested-common")
                    .value(
                        Maps.newHashMap(
                            ImmutableMap.of(
                                "default-param",
                                ParamDefinition.buildParamDefinition(
                                    "default-param", "from-default"),
                                "common-param",
                                ParamDefinition.buildParamDefinition(
                                    "common-param", "from-default"),
                                "double-nested-common",
                                MapParamDefinition.builder()
                                    .name("nested-common")
                                    .value(
                                        twoItemMap(
                                            "default-param",
                                            ParamDefinition.buildParamDefinition(
                                                "default-param", "from-default"),
                                            "common-param",
                                            ParamDefinition.buildParamDefinition(
                                                "common-param", "from-default")))
                                    .build(),
                                "double-nested-common-string",
                                StringMapParamDefinition.builder()
                                    .name("nested-common")
                                    .value(
                                        twoItemMap(
                                            "default-param", "from-default",
                                            "common-param", "from-default"))
                                    .build())))
                    .build(),
                "foo",
                ParamDefinition.buildParamDefinition("foo", "some-default"),
                "test-param",
                ParamDefinition.buildParamDefinition("test-param", "some-other-default")));
    TypedStep testStep = new TypedStep();
    testStep.setParams(
        ImmutableMap.of(
            "nested-step-new",
            MapParamDefinition.builder()
                .name("nested-step-new")
                .value(
                    singletonMap(
                        "step-new", ParamDefinition.buildParamDefinition("step-new", "from-step")))
                .build(),
            "nested-common",
            MapParamDefinition.builder()
                .name("nested-common")
                .value(
                    Maps.newHashMap(
                        ImmutableMap.of(
                            "step-param",
                            ParamDefinition.buildParamDefinition("step-param", "from-step"),
                            "common-param",
                            ParamDefinition.buildParamDefinition("common-param", "from-step"),
                            "double-nested-common",
                            MapParamDefinition.builder()
                                .name("nested-common")
                                .value(
                                    twoItemMap(
                                        "step-param",
                                        ParamDefinition.buildParamDefinition(
                                            "default-param", "from-step"),
                                        "common-param",
                                        ParamDefinition.buildParamDefinition(
                                            "common-param", "from-step")))
                                .build(),
                            "double-nested-common-string",
                            StringMapParamDefinition.builder()
                                .name("nested-common")
                                .value(
                                    twoItemMap(
                                        "step-param", "from-step",
                                        "common-param", "from-step"))
                                .build())))
                .build(),
            "foo",
            ParamDefinition.buildParamDefinition("foo", "bar"),
            "test-param",
            ParamDefinition.buildParamDefinition("test-param", "hello")));
    testStep.setType(StepType.NOOP);
    testStep.setId("step1");
    Map<String, Parameter> params =
        runtimeManager.getAllParams(testStep, workflowSummary, runtimeSummary);
    assertEquals("bar", params.get("foo").getValue());
    assertEquals("hello", params.get("test-param").getValue());
    assertEquals(
        "from-step",
        ((MapParameter) params.get("nested-step-new")).getValue().get("step-new").getValue());
    assertEquals(
        "from-default",
        ((MapParameter) params.get("nested-default-new")).getValue().get("default-new").getValue());
    assertEquals(
        "from-default",
        ((MapParameter) params.get("nested-common")).getValue().get("default-param").getValue());
    assertEquals(
        "from-step",
        ((MapParameter) params.get("nested-common")).getValue().get("step-param").getValue());
    assertEquals(
        "from-step",
        ((MapParameter) params.get("nested-common")).getValue().get("common-param").getValue());

    MapParamDefinition nestedMap =
        (MapParamDefinition)
            ((MapParameter) params.get("nested-common")).getValue().get("double-nested-common");
    assertEquals("from-default", nestedMap.getValue().get("default-param").getValue());
    assertEquals("from-step", nestedMap.getValue().get("step-param").getValue());
    assertEquals("from-step", nestedMap.getValue().get("common-param").getValue());

    StringMapParamDefinition nestedStringMap =
        (StringMapParamDefinition)
            ((MapParameter) params.get("nested-common"))
                .getValue()
                .get("double-nested-common-string");
    assertEquals("from-default", nestedStringMap.getValue().get("default-param"));
    assertEquals("from-step", nestedStringMap.getValue().get("step-param"));
    assertEquals("from-step", nestedStringMap.getValue().get("common-param"));
  }