-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving
lookupJobsForBuild
to return what is shown in the Sauce d…
…ocs. Added a test as well. https://docs.saucelabs.com/dev/api/builds/#lookup-jobs-in-a-build
- Loading branch information
Showing
6 changed files
with
270 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 91 additions & 60 deletions
151
src/main/java/com/saucelabs/saucerest/model/builds/Build.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,98 @@ | ||
|
||
package com.saucelabs.saucerest.model.builds; | ||
|
||
import com.saucelabs.saucerest.model.AbstractModel; | ||
import com.squareup.moshi.Json; | ||
|
||
public class Build extends AbstractModel { | ||
|
||
@Json(name = "creation_time") | ||
public Integer creationTime; | ||
@Json(name = "deletion_time") | ||
public Integer deletionTime; | ||
@Json(name = "end_time") | ||
public Integer endTime; | ||
@Json(name = "group_id") | ||
public String groupId; | ||
@Json(name = "id") | ||
public String id; | ||
@Json(name = "jobs") | ||
public Jobs jobs; | ||
@Json(name = "modification_time") | ||
public Integer modificationTime; | ||
@Json(name = "name") | ||
public String name; | ||
@Json(name = "org_id") | ||
public String orgId; | ||
@Json(name = "owner_id") | ||
public String ownerId; | ||
@Json(name = "passed") | ||
public Object passed; | ||
@Json(name = "public") | ||
public Boolean _public; | ||
@Json(name = "run") | ||
public Integer run; | ||
@Json(name = "source") | ||
public String source; | ||
@Json(name = "start_time") | ||
public Integer startTime; | ||
@Json(name = "status") | ||
public String status; | ||
@Json(name = "team_id") | ||
public String teamId; | ||
|
||
public Build() { | ||
} | ||
|
||
public Build(Integer creationTime, Integer deletionTime, Integer endTime, String groupId, String id, Jobs jobs, Integer modificationTime, String name, String orgId, String ownerId, Object passed, Boolean _public, Integer run, String source, Integer startTime, String status, String teamId) { | ||
super(); | ||
this.creationTime = creationTime; | ||
this.deletionTime = deletionTime; | ||
this.endTime = endTime; | ||
this.groupId = groupId; | ||
this.id = id; | ||
this.jobs = jobs; | ||
this.modificationTime = modificationTime; | ||
this.name = name; | ||
this.orgId = orgId; | ||
this.ownerId = ownerId; | ||
this.passed = passed; | ||
this._public = _public; | ||
this.run = run; | ||
this.source = source; | ||
this.startTime = startTime; | ||
this.status = status; | ||
this.teamId = teamId; | ||
} | ||
} | ||
@Json(name = "creation_time") | ||
public Integer creationTime; | ||
|
||
@Json(name = "deletion_time") | ||
public Integer deletionTime; | ||
|
||
@Json(name = "end_time") | ||
public Integer endTime; | ||
|
||
@Json(name = "group_id") | ||
public String groupId; | ||
|
||
@Json(name = "id") | ||
public String id; | ||
|
||
@Json(name = "jobs") | ||
public Jobs jobs; | ||
|
||
@Json(name = "modification_time") | ||
public Integer modificationTime; | ||
|
||
@Json(name = "name") | ||
public String name; | ||
|
||
@Json(name = "org_id") | ||
public String orgId; | ||
|
||
@Json(name = "owner_id") | ||
public String ownerId; | ||
|
||
@Json(name = "passed") | ||
public Object passed; | ||
|
||
@Json(name = "public") | ||
public Boolean _public; | ||
|
||
@Json(name = "run") | ||
public Integer run; | ||
|
||
@Json(name = "source") | ||
public String source; | ||
|
||
@Json(name = "start_time") | ||
public Integer startTime; | ||
|
||
@Json(name = "status") | ||
public String status; | ||
|
||
@Json(name = "team_id") | ||
public String teamId; | ||
|
||
public Build() {} | ||
|
||
public Build( | ||
Integer creationTime, | ||
Integer deletionTime, | ||
Integer endTime, | ||
String groupId, | ||
String id, | ||
Jobs jobs, | ||
Integer modificationTime, | ||
String name, | ||
String orgId, | ||
String ownerId, | ||
Object passed, | ||
Boolean _public, | ||
Integer run, | ||
String source, | ||
Integer startTime, | ||
String status, | ||
String teamId) { | ||
super(); | ||
this.creationTime = creationTime; | ||
this.deletionTime = deletionTime; | ||
this.endTime = endTime; | ||
this.groupId = groupId; | ||
this.id = id; | ||
this.jobs = jobs; | ||
this.modificationTime = modificationTime; | ||
this.name = name; | ||
this.orgId = orgId; | ||
this.ownerId = ownerId; | ||
this.passed = passed; | ||
this._public = _public; | ||
this.run = run; | ||
this.source = source; | ||
this.startTime = startTime; | ||
this.status = status; | ||
this.teamId = teamId; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/com/saucelabs/saucerest/model/builds/JobInBuild.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.saucelabs.saucerest.model.builds; | ||
|
||
import com.squareup.moshi.Json; | ||
|
||
public class JobInBuild { | ||
|
||
@Json(name = "creation_time") | ||
public Integer creationTime; | ||
|
||
@Json(name = "deletion_time") | ||
public Integer deletionTime; | ||
|
||
@Json(name = "id") | ||
public String id; | ||
|
||
@Json(name = "modification_time") | ||
public Integer modificationTime; | ||
|
||
@Json(name = "state") | ||
public State state; | ||
|
||
/** No args constructor for use in serialization */ | ||
public JobInBuild() {} | ||
|
||
public JobInBuild( | ||
Integer creationTime, | ||
Integer deletionTime, | ||
String id, | ||
Integer modificationTime, | ||
State state) { | ||
this.creationTime = creationTime; | ||
this.deletionTime = deletionTime; | ||
this.id = id; | ||
this.modificationTime = modificationTime; | ||
this.state = state; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/saucelabs/saucerest/model/builds/JobsInBuild.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.saucelabs.saucerest.model.builds; | ||
|
||
import com.squareup.moshi.Json; | ||
|
||
import java.util.List; | ||
|
||
public class JobsInBuild { | ||
|
||
@Json(name = "jobs") | ||
public List<JobInBuild> jobs; | ||
|
||
/** No args constructor for use in serialization */ | ||
public JobsInBuild() {} | ||
|
||
public JobsInBuild(List<JobInBuild> jobs) { | ||
this.jobs = jobs; | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/com/saucelabs/saucerest/model/builds/State.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.saucelabs.saucerest.model.builds; | ||
|
||
import com.squareup.moshi.Json; | ||
|
||
public class State { | ||
|
||
@Json(name = "completed") | ||
public Boolean completed; | ||
|
||
@Json(name = "errored") | ||
public Boolean errored; | ||
|
||
@Json(name = "failed") | ||
public Boolean failed; | ||
|
||
@Json(name = "finished") | ||
public Boolean finished; | ||
|
||
@Json(name = "new") | ||
public Boolean _new; | ||
|
||
@Json(name = "passed") | ||
public Boolean passed; | ||
|
||
@Json(name = "public") | ||
public Boolean _public; | ||
|
||
@Json(name = "queued") | ||
public Boolean queued; | ||
|
||
@Json(name = "running") | ||
public Boolean running; | ||
|
||
/** No args constructor for use in serialization */ | ||
public State() {} | ||
|
||
public State( | ||
Boolean completed, | ||
Boolean errored, | ||
Boolean failed, | ||
Boolean finished, | ||
Boolean _new, | ||
Boolean passed, | ||
Boolean _public, | ||
Boolean queued, | ||
Boolean running) { | ||
this.completed = completed; | ||
this.errored = errored; | ||
this.failed = failed; | ||
this.finished = finished; | ||
this._new = _new; | ||
this.passed = passed; | ||
this._public = _public; | ||
this.queued = queued; | ||
this.running = running; | ||
} | ||
} |
Oops, something went wrong.