leehaut opened a new pull request, #8558:
URL: https://github.com/apache/hop/pull/8558

   Fix https://github.com/apache/hop/issues/8545
   
   ## Summary
   
   - Fix HTTP / HTTP Post / REST `check()` wrongly reporting 
`TYPE_RESULT_ERROR` when URL or method field names are correctly specified 
(message said Ok, type was Error).
   - Fix `IndexOutOfBoundsException` when opening the HTTP Post dialog for 
transforms saved without a `<lookup>` element (empty `lookupFields`).
   - Add / tighten unit tests for the corrected check paths and empty 
lookup/result field access.
   
   ## Changes
   
   ### 1. Check result type mismatch
   
   Success branches used `ICheckResult.TYPE_RESULT_ERROR` with Ok message keys:
   
   | Transform | Class | Message key |
   |-----------|--------|-------------|
   | HTTP | `HttpMeta` | `HTTPMeta.CheckResult.UrlfieldOk` |
   | HTTP Post | `HttpPostMeta` | `HTTPPOSTMeta.CheckResult.UrlfieldOk` |
   | REST | `RestMeta` | `RestMeta.CheckResult.MethodFieldOk` |
   
   Changed to `TYPE_RESULT_OK`. (`RestMeta` URL-field success path was already 
correct.)
   
   ### 2. HTTP Post dialog crash on empty lookup list
   
   Pipelines without a `<lookup>` node deserialize with an empty `lookupFields` 
list. The dialog and runtime called `.get(0)` and crashed:
   
   `IndexOutOfBoundsException` at `HttpPostDialog.setupBodyParamBlock`.
   
   - Added `HttpPostMeta.getFirstLookupField()` / `getFirstResultField()` to 
create a default entry when missing.
   - Updated `HttpPostDialog`, `HttpPost`, and `HttpPostMeta.getFields()` to 
use these helpers.
   - Removed a incorrect `clear()` inside the query-parameter loop in `ok()`.
   
   ## Test plan
   
   - [x] Unit: `HttpMetaTest`, `HttpPostMetaTest`, `RestMetaTest`
   - [x] Open a pipeline with HTTP / HTTP Post (URL in field) and REST (dynamic 
method); run **Check** — specified field remarks should be **OK**, not ERROR
   - [x] Open HTTP Post on a transform with no body/query parameters (no 
`<lookup>` in XML) — dialog opens without exception
   - [x] Save and re-open HTTP Post; verify URL-in-field and result fields 
still round-trip correctly


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to