Skip to content

Commit

Permalink
enh: Override HTTP and HTTPS ports via system properties
Browse files Browse the repository at this point in the history
  • Loading branch information
lprimak committed Feb 9, 2024
1 parent 9f31789 commit 7b2fc75
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
package fish.payara.arquillian.container.payara.clientutils;

import java.net.URI;
import java.util.Optional;
import static java.util.function.Predicate.not;

/**
* @author Z.Paulovics
Expand Down Expand Up @@ -103,8 +105,12 @@ public NodeAddress(String host) {
public NodeAddress(String serverName, String host, int port, int secure_port) {
this.serverName = serverName;
this.host = host;
this.httpPort = port;
this.httpsPort = secure_port;
this.httpPort = Optional.ofNullable(System.getProperty("httpPort"))
.filter(not(String::isEmpty))
.map(Integer::parseInt).orElse(port);
this.httpsPort = Optional.ofNullable(System.getProperty("httpsPort"))
.filter(not(String::isEmpty))
.map(Integer::parseInt).orElse(secure_port);
}

/**
Expand Down

0 comments on commit 7b2fc75

Please sign in to comment.