From 70b35de6342ffe12cf846a093766f6df8be99c7b Mon Sep 17 00:00:00 2001 From: Bart Maertens Date: Sat, 18 Jan 2025 13:47:34 +0100 Subject: [PATCH] minor tweak + integration test. fixes #4369 --- .../http/0017-rest-metadata-type.hpl | 194 ++++++++++++++++++ .../http/main-0017-rest-metadata-type.hwf | 97 +++++++++ .../metadata/restconnection/castlemock.json | 9 + .../pipeline/transforms/rest/RestDialog.java | 2 + 4 files changed, 302 insertions(+) create mode 100644 integration-tests/http/0017-rest-metadata-type.hpl create mode 100644 integration-tests/http/main-0017-rest-metadata-type.hwf create mode 100644 integration-tests/http/metadata/restconnection/castlemock.json diff --git a/integration-tests/http/0017-rest-metadata-type.hpl b/integration-tests/http/0017-rest-metadata-type.hpl new file mode 100644 index 00000000000..335c76e3f2f --- /dev/null +++ b/integration-tests/http/0017-rest-metadata-type.hpl @@ -0,0 +1,194 @@ + + + + + 0017-rest-metadata-type + Y + + + + Normal + 0 + + + HOSTNAME + localhost + + + + N + 1000 + 100 + - + 2025/01/18 10:07:08.642 + - + 2025/01/18 10:07:08.642 + + + + + + Generate rows + REST client + Y + + + check result + Abort + Y + + + REST client + check result + Y + + + + Abort + Abort + + Y + + 1 + + none + + + ABORT_WITH_ERROR + Y + 0 + + + 672 + 160 + + + + Generate rows + RowGenerator + + Y + + 1 + + none + + + + + 5000 + FiveSecondsAgo + 1 + N + now + + + 192 + 160 + + + + REST client + Rest + + Y + + 1 + + none + + + TEXT PLAIN + + + castlemock + N + + + + Encrypted + N + + + GET + + + + N + + + + + result_code + result + response_header + response_ms + + + Encrypted + /get + + N + + + 352 + 160 + + + + check result + FilterRows + + Y + + 1 + + none + + + + + + + = + result_code + Y + - + + N + -1 + # + constant + 0 + 200 + Integer + + + + + + 512 + 160 + + + + + + diff --git a/integration-tests/http/main-0017-rest-metadata-type.hwf b/integration-tests/http/main-0017-rest-metadata-type.hwf new file mode 100644 index 00000000000..9d76fd013a1 --- /dev/null +++ b/integration-tests/http/main-0017-rest-metadata-type.hwf @@ -0,0 +1,97 @@ + + + + main-0017-rest-metadata-type + Y + + + + - + 2025/01/18 10:06:40.272 + - + 2025/01/18 10:06:40.272 + + + + + Start + + SPECIAL + + 1 + 12 + 60 + 0 + 0 + N + 0 + 1 + N + 50 + 50 + + + + 0017-rest-metadata-type.hpl + + PIPELINE + + N + N + N + N + N + N + ${PROJECT_HOME}/0017-rest-metadata-type.hpl + + + Basic + + + HOSTNAME + + ${HOSTNAME} + + Y + + N + local + N + N + Y + N + 256 + 64 + + + + + + Start + 0017-rest-metadata-type.hpl + Y + Y + Y + + + + + + diff --git a/integration-tests/http/metadata/restconnection/castlemock.json b/integration-tests/http/metadata/restconnection/castlemock.json new file mode 100644 index 00000000000..f6a2fcc05a1 --- /dev/null +++ b/integration-tests/http/metadata/restconnection/castlemock.json @@ -0,0 +1,9 @@ +{ + "auth_header_value": "", + "auth_header_name": "", + "virtualPath": "", + "auth_header_prefix": "", + "base_url": "http://${HOSTNAME}", + "name": "castlemock", + "test_url": "" +} \ No newline at end of file diff --git a/plugins/transforms/rest/src/main/java/org/apache/hop/pipeline/transforms/rest/RestDialog.java b/plugins/transforms/rest/src/main/java/org/apache/hop/pipeline/transforms/rest/RestDialog.java index 44ca60f330d..3bae5d0defb 100644 --- a/plugins/transforms/rest/src/main/java/org/apache/hop/pipeline/transforms/rest/RestDialog.java +++ b/plugins/transforms/rest/src/main/java/org/apache/hop/pipeline/transforms/rest/RestDialog.java @@ -1469,6 +1469,8 @@ private void ok() { if (!Utils.isEmpty(wSelectionLine.getText())) { input.setConnectionName(wSelectionLine.getText()); + } else { + input.setConnectionName(""); } input.getHeaderFields().clear();