Object getFromSignal(String signalName, String paramName) {
    try {
      return executor
          .submit(() -> fromSignal(signalName, paramName))
          .get(TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS);
    } catch (Exception e) {
      throw new MaestroInternalError(
          e,
          "getFromSignal throws an exception for signalName=[%s], paramName=[%s]",
          signalName,
          paramName);
    }
  }
@Test
  public void testInvalidGetFromSignal() {
    SignalInitiator initiator = Mockito.mock(SignalInitiator.class);
    when(instanceWrapper.getInitiator()).thenReturn(initiator);

    when(initiator.getType()).thenReturn(Initiator.Type.TIME);
    AssertHelper.assertThrows(
        "Cannot get a param from non signal initiator",
        MaestroInternalError.class,
        "getFromSignal throws an exception",
        () -> paramExtension.getFromSignal("signal-a", "param1"));

    when(initiator.getType()).thenReturn(Initiator.Type.SIGNAL);

    AssertHelper.assertThrows(
        "signal initiator's param is null",
        MaestroInternalError.class,
        "getFromSignal throws an exception",
        () -> paramExtension.getFromSignal("signal-a", "param1"));

    when(initiator.getParams()).thenReturn(Collections.emptyMap());

    AssertHelper.assertThrows(
        "Cannot find signal",
        MaestroInternalError.class,
        "getFromSignal throws an exception",
        () -> paramExtension.getFromSignal("signal-not-existing", "param1"));

    when(initiator.getParams())
        .thenReturn(
            singletonMap("signal-a", StringParameter.builder().evaluatedResult("foo").build()));

    AssertHelper.assertThrows(
        "Invalid param type, which must be MAP or STRING_MAP",
        MaestroInternalError.class,
        "getFromSignal throws an exception",
        () -> paramExtension.getFromSignal("signal-a", "param1"));

    when(initiator.getParams())
        .thenReturn(
            twoItemMap(
                "signal-a",
                StringMapParameter.builder()
                    .evaluatedResult(singletonMap("param1", "value1"))
                    .build(),
                "signal-b",
                MapParameter.builder().evaluatedResult(singletonMap("param2", 123L)).build()));

    AssertHelper.assertThrows(
        "Cannot find param from the signal",
        MaestroInternalError.class,
        "getFromSignal throws an exception",
        () -> paramExtension.getFromSignal("signal-a", "param-not-existing"));

    AssertHelper.assertThrows(
        "Cannot find string param from the signal",
        MaestroInternalError.class,
        "getFromSignal throws an exception",
        () -> paramExtension.getFromSignal("signal-b", "param-not-existing"));
  }