Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Remove unneeded class variable
Browse files Browse the repository at this point in the history
Signed-off-by: Moti Asayag <masayag@redhat.com>
  • Loading branch information
masayag authored and openshift-merge-robot committed May 21, 2023
1 parent 7a11533 commit 586ad7b
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@
@Slf4j
public abstract class SdkUtils {

private static String serverIp = "localhost";

private SdkUtils() {
}

/**
* Creates and configures the APIClient using the configuration properties available
* in `sdk-config.yml`
* in environment variables.
* @return the ApiClient
*/
public static ApiClient getParodosAPiClient()
throws ApiException, MissingRequiredPropertiesException, InterruptedException {
ApiClient apiClient = Configuration.getDefaultApiClient();
serverIp = Optional.ofNullable(System.getenv("SERVER_IP")).orElse("localhost");
String serverIp = Optional.ofNullable(System.getenv("SERVER_IP")).orElse("localhost");
String serverPort = Optional.ofNullable(System.getenv("SERVER_PORT")).orElse("8080");

if (Strings.isNullOrEmpty(serverIp) || Strings.isNullOrEmpty(serverPort)) {
Expand All @@ -63,7 +61,7 @@ public static ApiClient getParodosAPiClient()
throw new IllegalArgumentException("serverPort must be > 0 && <= 65535");
}

String basePath = "http://" + serverIp + ":" + serverPort;
String basePath = "http://%s:%s".formatted(serverIp, serverPort);
log.info("serverIp is: {}, serverPort is {}. Set BasePath to {}", serverIp, serverPort, basePath);

apiClient.setBasePath(basePath);
Expand Down Expand Up @@ -361,8 +359,4 @@ public static ProjectResponseDTO getProjectAsync(ApiClient apiClient, String pro
return testProject;
}

public static String getServerIp() {
return serverIp;
}

}

0 comments on commit 586ad7b

Please sign in to comment.