aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-09-04 13:49:22 +0300
committerIttay Stern <ittay.stern@att.com>2019-09-04 14:15:24 +0300
commit0ccf8ebba94447e7e7004c1a14049f679b0f28b2 (patch)
tree7bb8aa6f3d470f23ba35da6af1af9a933243f7ca /vid-automation/src
parent87c87c875e0c0bba90e4ed911c8066dcfa85c517 (diff)
Improve vid-simulator cloud-nativeness
Issue-ID: VID-608 * Integrative tests will look at `SIM_HOST` that may differ from `VID_HOST`. * Simulator will look at `hibernate.connection.url` property for db-connection config * Don't skip DB connection if schema not ready, by removing schema validation Change-Id: Idb4587c30dd0cbc0fe7e7362cb691a4cb425fd10 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src')
-rw-r--r--vid-automation/src/main/java/vid/automation/test/services/SimulatorApi.java39
1 files changed, 19 insertions, 20 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 4fede294d..aae494f84 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
@@ -1,8 +1,26 @@
package vid.automation.test.services;
+import static org.testng.Assert.assertEquals;
+import static vid.automation.test.services.DropTestApiField.dropFieldCloudOwnerFromString;
+import static vid.automation.test.services.DropTestApiField.dropTestApiFieldFromString;
+
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import java.net.URI;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.function.UnaryOperator;
+import java.util.stream.Collectors;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider;
@@ -14,25 +32,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import vid.automation.test.utils.ReadFile;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.net.URI;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.function.UnaryOperator;
-import java.util.stream.Collectors;
-
-import static org.testng.Assert.assertEquals;
-import static vid.automation.test.services.DropTestApiField.dropFieldCloudOwnerFromString;
-import static vid.automation.test.services.DropTestApiField.dropTestApiFieldFromString;
-
public class SimulatorApi {
public enum RegistrationStrategy {
@@ -63,7 +62,7 @@ public class SimulatorApi {
ImmutableList.of(dropTestApiFieldFromString(), dropFieldCloudOwnerFromString());
static {
- String host = System.getProperty("VID_HOST", "127.0.0.1" );
+ String host = System.getProperty("SIM_HOST", System.getProperty("VID_HOST", "127.0.0.1"));
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();