import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.not;
-//import com.automation.common.report_portal_integration.listeners.ReportPortalListener;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import java.util.Random;
import java.util.TimeZone;
import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import vid.automation.test.infra.FeaturesTogglingConfiguration;
import vid.automation.test.services.UsersService;
import vid.automation.test.utils.CookieAndJsonHttpHeadersInterceptor;
+import vid.automation.test.utils.InsecureHttpsClient;
@Listeners(ReportPortalListenerDelegator.class)
public class BaseApiTest {
@SuppressWarnings("WeakerAccess")
protected Client client;
protected Random random;
- protected final RestTemplate restTemplate = new RestTemplate();
+ protected final RestTemplate restTemplate = InsecureHttpsClient.newRestTemplate();
- protected final UsersService usersService = new UsersService();
- protected final RestTemplate restTemplateErrorAgnostic = new RestTemplate();
+ protected static final UsersService usersService = new UsersService();
+ protected final RestTemplate restTemplateErrorAgnostic = InsecureHttpsClient.newRestTemplate();
@BeforeClass
public void init() {
uri = getUri();
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
- client = ClientBuilder.newClient();
+ client = InsecureHttpsClient.newJaxrsClient();
client.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
random = new Random(System.currentTimeMillis());
FeaturesTogglingConfiguration.initializeFeatureManager();
private URI getUri() {
String host = System.getProperty("VID_HOST", "127.0.0.1");
int port = Integer.valueOf(System.getProperty("VID_PORT", "8080"));
- return new JerseyUriBuilder().host(host).port(port).scheme("http").path("vid").build();
+ String protocol = System.getProperty("VID_PROTOCOL", "http");
+ return new JerseyUriBuilder().host(host).port(port).scheme(protocol).path("vid").build();
}
public void login() {