com.testvagrant.optimus.core.remote.CloudConfigBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of optimus-lite Show documentation
Show all versions of optimus-lite Show documentation
Optimus Lite API to manage test devices and create appium driver based on platform
package com.testvagrant.optimus.core.remote;
import com.testvagrant.optimus.commons.SystemProperties;
import com.testvagrant.optimus.core.models.CloudConfig;
public class CloudConfigBuilder {
private final String userName;
private final String accessKey;
private final CloudConfig cloudConfig;
public CloudConfigBuilder() {
userName = System.getenv("username");
accessKey = System.getenv("accessKey");
cloudConfig = new ConfigLoader().loadConfig();
overrideCloudConfig(cloudConfig);
overrideHub(cloudConfig);
}
public CloudConfig build() {
return cloudConfig;
}
private void overrideHub(CloudConfig cloudConfig) {
if (cloudConfig.getHub() == null) {
cloudConfig.setHub(SystemProperties.HUB);
}
}
private void overrideCloudConfig(CloudConfig cloudConfig) {
if (userName != null) cloudConfig.setUsername(userName);
if (accessKey != null) cloudConfig.setAccessKey(accessKey);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy