Object getFromInstance(String fieldName) {
    try {
      Object ret =
          executor
              .submit(() -> fromInstance(fieldName))
              .get(TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS);
      // As param does not allow null, using empty space indicates unset for now.
      return ret == null ? "" : ret;
    } catch (Exception e) {
      throw new MaestroInternalError(
          e, "getFromInstance throws an exception for fieldName=[%s]", fieldName);
    }
  }
@Test
  public void testInvalidGetFromInstance() {
    when(instanceWrapper.isWorkflowParam()).thenReturn(false);
    AssertHelper.assertThrows(
        "Invalid field",
        MaestroInternalError.class,
        "getFromInstance throws an exception for fieldName=[invalid_field]",
        () -> paramExtension.getFromInstance("invalid_field"));
    AssertHelper.assertThrows(
        "Invalid call for non-workflow param",
        MaestroInternalError.class,
        "getFromInstance throws an exception for fieldName=[owner]",
        () -> paramExtension.getFromInstance(Constants.WORKFLOW_OWNER_PARAM));
    AssertHelper.assertThrows(
        "Invalid call for non-workflow param",
        MaestroInternalError.class,
        "getFromInstance throws an exception for fieldName=[FIRST_TIME_TRIGGER_TIMEZONE]",
        () -> paramExtension.getFromInstance(Constants.FIRST_TIME_TRIGGER_TIMEZONE_PARAM));

    when(instanceWrapper.getInitiator()).thenReturn(new SubworkflowInitiator());
    AssertHelper.assertThrows(
        "Invalid call for non-workflow param",
        MaestroInternalError.class,
        "getFromInstance throws an exception for fieldName=[INITIATOR_RUNNER_NAME]",
        () -> paramExtension.getFromInstance(Constants.INITIATOR_RUNNER_NAME));
  }