Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>browserstack-integration</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.2-debug-1</version>
<packaging>hpi</packaging>

<name>BrowserStack</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

import com.browserstack.automate.ci.common.Tools;
import com.browserstack.automate.ci.common.constants.Constants;
import com.browserstack.automate.ci.common.logger.PluginLogger;
import com.browserstack.automate.ci.common.proxysettings.JenkinsProxySettings;
import hudson.model.TaskListener;
import okhttp3.Authenticator;
import okhttp3.Call;
import okhttp3.Callback;
Expand All @@ -14,6 +16,7 @@
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.Route;
import org.apache.log4j.Logger;
import org.json.JSONObject;

import javax.annotation.Nullable;
Expand All @@ -23,14 +26,18 @@
import java.util.Optional;

public class PluginsTracker {
private static final MediaType JSON = MediaType.get("application/json; charset=utf-8");

private static final String URL = "https://api.browserstack.com/ci_plugins/track";
private final String trackingId;
private transient OkHttpClient client;
private String username;
private String accessKey;
private String customProxy;

static {
Logger.getLogger(PluginsTracker.class).info("BrowserStack Plugin Tracker Initialized");
}

public PluginsTracker(final String username, final String accessKey, @Nullable final String customProxy) {
this.username = username;
this.accessKey = accessKey;
Expand All @@ -52,7 +59,7 @@ public PluginsTracker(@Nullable final String customProxy) {
}

private void asyncPostRequestSilent(final String url, final String json) {
RequestBody body = RequestBody.create(JSON, json);
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json);
Request request = new Request.Builder()
.url(url)
.post(body)
Expand Down