Rest connection should use Base URL when Test URL is empty, fixes #5681 (#5682)
diff --git a/plugins/misc/rest/src/main/java/org/apache/hop/metadata/rest/RestConnectionEditor.java b/plugins/misc/rest/src/main/java/org/apache/hop/metadata/rest/RestConnectionEditor.java
index 096ea05..f71acd0 100644
--- a/plugins/misc/rest/src/main/java/org/apache/hop/metadata/rest/RestConnectionEditor.java
+++ b/plugins/misc/rest/src/main/java/org/apache/hop/metadata/rest/RestConnectionEditor.java
@@ -195,9 +195,10 @@
restConnection.setName(wName.getText());
if (StringUtils.isEmpty(wTestUrl.getText())) {
restConnection.setTestUrl(wBaseUrl.getText());
+ } else {
+ restConnection.setTestUrl(wTestUrl.getText());
}
restConnection.setBaseUrl(wBaseUrl.getText());
- restConnection.setTestUrl(wTestUrl.getText());
restConnection.setAuthorizationHeaderName(wAuthorizationName.getText());
restConnection.setAuthorizationPrefix(wAuthorizationPrefix.getText());
restConnection.setAuthorizationHeaderValue(wAuthorizationValue.getText());
@@ -208,7 +209,7 @@
String message =
BaseMessages.getString(PKG, "RestConnectionEditor.ConnectionTestSuccess") + Const.CR;
message += Const.CR;
- message += "URL : " + wTestUrl.getText();
+ message += "URL : " + restConnection.getTestUrl();
box.setMessage(message);
box.open();
} catch (Exception e) {