Skip to content

Added new attributes for automation_session object and updated endpoint #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
changes method names to camel case
  • Loading branch information
Hani committed Aug 7, 2018
commit d5f91bb87a2e3a7919660e06caf499213b97aa37
12 changes: 6 additions & 6 deletions src/main/java/com/browserstack/automate/AutomateClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,12 @@ public final String getSessionConsoleLogs(final Session session) throws Automate
throw new AutomateException("Invalid session", 400);
}

if (session.getBrowser_console_logs_url() == null) {
if (session.getBrowserConsoleLogsUrl() == null) {
throw new AutomateException("Session logs not found", 404);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message should be "Session console logs not found."

}

try {
BrowserStackRequest request = newRequest(Method.GET, session.getBrowser_console_logs_url(), false);
BrowserStackRequest request = newRequest(Method.GET, session.getBrowserConsoleLogsUrl(), false);
request.getHttpRequest().getHeaders().setAccept("*/*");
return request.asString();
} catch (BrowserStackException e) {
Expand Down Expand Up @@ -495,12 +495,12 @@ public final String getSessionHARLogs(final Session session) throws AutomateExce
throw new AutomateException("Invalid session", 400);
}

if (session.getHar_logs_url() == null) {
if (session.getHarLogsUrl() == null) {
throw new AutomateException("Session logs not found", 404);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message should be "Session HAR logs not found."

}

try {
BrowserStackRequest request = newRequest(Method.GET, session.getHar_logs_url(), false);
BrowserStackRequest request = newRequest(Method.GET, session.getHarLogsUrl(), false);
request.getHttpRequest().getHeaders().setAccept("*/*");
return request.asString();
} catch (BrowserStackException e) {
Expand Down Expand Up @@ -532,12 +532,12 @@ public final String getSessionAppiumLogs(final Session session) throws AutomateE
throw new AutomateException("Invalid session", 400);
}

if (session.getAppium_logs_url() == null) {
if (session.getAppiumLogsUrl() == null) {
throw new AutomateException("Session logs not found", 404);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message should be "Session appium logs not found."

}

try {
BrowserStackRequest request = newRequest(Method.GET, session.getAppium_logs_url(), false);
BrowserStackRequest request = newRequest(Method.GET, session.getAppiumLogsUrl(), false);
request.getHttpRequest().getHeaders().setAccept("*/*");
return request.asString();
} catch (BrowserStackException e) {
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/browserstack/automate/model/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,47 +393,47 @@ private void setOs(String os) {
* @return The browser_console_logs_url
*/
@JsonProperty("browser_console_logs_url")
public String getBrowser_console_logs_url() {
public String getBrowserConsoleLogsUrl() {
return browser_console_logs_url;
}

/**
* @param browser_console_logs_url The browser_console_logs_url
*/
@JsonProperty("browser_console_logs_url")
private void setBrowser_console_logs_url(String browser_console_logs_url) {
private void setBrowserConsoleLogsUrl(String browser_console_logs_url) {
this.browser_console_logs_url = browser_console_logs_url;
}

/**
* @return The har_logs_url
*/
@JsonProperty("har_logs_url")
public String getHar_logs_url() {
public String getHarLogsUrl() {
return har_logs_url;
}

/**
* @param har_logs_url The har_logs_url
*/
@JsonProperty("har_logs_url")
private void setHar_logs_url(String har_logs_url) {
private void setHarLogsUrl(String har_logs_url) {
this.har_logs_url = har_logs_url;
}

/**
* @return The appium_logs_url
*/
@JsonProperty("appium_logs_url")
public String getAppium_logs_url() {
public String getAppiumLogsUrl() {
return appium_logs_url;
}

/**
* @param appium_logs_url The appium_logs_url
*/
@JsonProperty("appium_logs_url")
private void setAppium_logs_url(String appium_logs_url) {
private void setAppiumLogsUrl(String appium_logs_url) {
this.appium_logs_url = appium_logs_url;
}

Expand Down Expand Up @@ -462,9 +462,9 @@ private boolean copyFrom(Session s) {
setLogUrl(s.getLogUrl());
setStatus(s.getStatus());
setReason(s.getReason());
setBrowser_console_logs_url(s.getBrowser_console_logs_url());
setHar_logs_url(s.getHar_logs_url());
setAppium_logs_url(s.getAppium_logs_url());
setBrowserConsoleLogsUrl(s.getBrowserConsoleLogsUrl());
setHarLogsUrl(s.getHarLogsUrl());
setAppiumLogsUrl(s.getAppiumLogsUrl());
this.additionalProperties = s.getAdditionalProperties();
return true;
}
Expand Down