aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/vid/automation/test/services
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-11-12 09:05:39 +0200
committerIttay Stern <ittay.stern@att.com>2019-11-12 10:53:21 +0200
commit94a4b28106871d54d8b159acb75e926609ab7db1 (patch)
treee79d055cdfb145431ee46b6ab73feba29f891a85 /vid-automation/src/main/java/vid/automation/test/services
parent3d84cd65eef3fb2acb459015f692f1bd03212e7f (diff)
AAF tests presets should redirect to simulator by it's config
Issue-ID: VID-701 Change-Id: Ie1d0c78ec15e127fc782978175df4f608587a94a Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java/vid/automation/test/services')
-rw-r--r--vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java b/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java
index 6e15b7b52..ff8f209a8 100644
--- a/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java
+++ b/vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java
@@ -82,7 +82,7 @@ public class SimulatorApi {
ImmutableList.of(dropTestApiFieldFromString(), dropFieldCloudOwnerFromString());
static {
- String host = System.getProperty("SIM_HOST", System.getProperty("VID_HOST", "127.0.0.1"));
+ String host = getSimulatorHost();
Integer port = Integer.valueOf(System.getProperty("SIM_PORT", System.getProperty("VID_PORT", "8080"))); //port for registration
uri = new JerseyUriBuilder().host(host).port(port).scheme("http").path("vidSimulator").build();
client = ClientBuilder.newClient();
@@ -94,10 +94,18 @@ public class SimulatorApi {
jacksonJsonProvider.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
client.register(jacksonJsonProvider);
- Integer simulationPort = Integer.valueOf(System.getProperty("SIMULATION_PORT", "1080")); //port getting simulated responses
+ Integer simulationPort = getSimulatedResponsesPort();
simulationUri = new JerseyUriBuilder().host(host).port(simulationPort).scheme("http").build();
}
+ public static String getSimulatorHost() {
+ return System.getProperty("SIM_HOST", System.getProperty("VID_HOST", "127.0.0.1"));
+ }
+
+ public static Integer getSimulatedResponsesPort() {
+ return Integer.valueOf(System.getProperty("SIMULATION_PORT", "1080"));
+ }
+
public static URI getSimulationUri() {
return simulationUri;
}