All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.testvagrant.optimus.core.remote.RemoteUrlBuilder Maven / Gradle / Ivy

Go to download

Optimus Lite API to manage test devices and create appium driver based on platform

There is a newer version: 0.1.7-beta
Show newest version
package com.testvagrant.optimus.core.remote;

import com.testvagrant.optimus.core.models.CloudConfig;

import java.net.URL;

public class RemoteUrlBuilder {

  public static URL build(CloudConfig cloudConfig) {
    try {
      String urlString;
      if(!cloudConfig.getUrl().isEmpty()) {
        urlString = cloudConfig.getUrl();
      } else {
        urlString =
                String.format(
                        "%s://%s:%s@%s/wd/hub",
                        cloudConfig.getProtocol(),cloudConfig.getUsername(), cloudConfig.getAccessKey(), cloudConfig.getHub());
      }
      return new URL(urlString);
    } catch (Exception ex) {
      throw new RuntimeException(ex.getMessage());
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy