NIFI-6944 This closes #3928. fixed NiFiClientUtil.getUrl and modified NiFiClientUtilSpec to test non-default WEB_HTTP_PORT

Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
Drew Kerrigan 2019-12-11 19:35:51 -05:00 committed by Joe Witt
parent de2a286a7a
commit 3015ee39da
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
2 changed files with 4 additions and 3 deletions

View File

@ -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)) {

View File

@ -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"
}