Skip to content

Commit

Permalink
NIFI-6944 This closes apache#3928. fixed NiFiClientUtil.getUrl and mo…
Browse files Browse the repository at this point in the history
…dified NiFiClientUtilSpec to test non-default WEB_HTTP_PORT

Signed-off-by: Joe Witt <joewitt@apache.org>
  • Loading branch information
Drew Kerrigan authored and natural committed Feb 1, 2020
1 parent 55b95e0 commit 0871c28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class NiFiClientUtil {
urlBuilder.append("http://")
urlBuilder.append(StringUtils.isEmpty(niFiProperties.getProperty(NiFiProperties.WEB_HTTP_HOST)) ? "localhost": niFiProperties.getProperty(NiFiProperties.WEB_HTTP_HOST))
urlBuilder.append(":")
urlBuilder.append(StringUtils.isEmpty(niFiProperties.getProperty(NiFiProperties.WEB_HTTPS_PORT)) ? "8080": niFiProperties.getProperty(NiFiProperties.WEB_HTTPS_PORT))
urlBuilder.append(StringUtils.isEmpty(niFiProperties.getProperty(NiFiProperties.WEB_HTTP_PORT)) ? "8080": niFiProperties.getProperty(NiFiProperties.WEB_HTTP_PORT))
}

if(!StringUtils.isEmpty(endpoint)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ class NiFiClientUtilSpec extends Specification{

then:

3 * niFiProperties.getProperty(_)
url == "http://localhost:8080/nifi-api/controller/cluster/nodes/1"
2 * niFiProperties.getProperty(_)
niFiProperties.getProperty(NiFiProperties.WEB_HTTP_PORT) >> "8000"
url == "http://localhost:8000/nifi-api/controller/cluster/nodes/1"
}


Expand Down

0 comments on commit 0871c28

Please sign in to comment.