File tree Expand file tree Collapse file tree 3 files changed +6
-22
lines changed
main/java/com/browserstack/automate
test/java/com/browserstack/automate Expand file tree Collapse file tree 3 files changed +6
-22
lines changed Original file line number Diff line number Diff line change @@ -96,21 +96,14 @@ public final List<Browser> getBrowsers(final boolean cache) throws AutomateExcep
9696 */
9797 public final List <Project > getProjects () throws AutomateException {
9898 List <Project > projects = new ArrayList <Project >();
99- ProjectNode [] projectNodes ;
10099
101100 try {
102- projectNodes = newRequest (Method .GET , "/projects.json" )
103- .asObject (ProjectNode [].class );
101+ projects = Arrays . asList ( newRequest (Method .GET , "/projects.json" )
102+ .asObject (Project [].class ) );
104103 } catch (BrowserStackException e ) {
105104 throw new AutomateException (e );
106105 }
107106
108- for (ProjectNode pn : projectNodes ) {
109- if (pn != null && pn .getProject () != null ) {
110- projects .add (pn .getProject ().<Project >setClient (this ));
111- }
112- }
113-
114107 return projects ;
115108 }
116109
Original file line number Diff line number Diff line change @@ -176,20 +176,10 @@ public List<Build> getBuilds() throws AutomateException {
176176 }
177177
178178 /**
179- * @param buildNodes The builds
179+ * @param builds The builds
180180 */
181181 @ JsonProperty ("builds" )
182- private void setBuilds (List <BuildNode > buildNodes ) {
183- List <Build > builds = new ArrayList <Build >();
184-
185- if (buildNodes != null ) {
186- for (BuildNode buildNode : buildNodes ) {
187- if (buildNode != null && buildNode .getBuild () != null ) {
188- builds .add (buildNode .getBuild ());
189- }
190- }
191- }
192-
182+ private void setBuilds (List <Build > builds ) {
193183 this .builds = builds ;
194184 }
195185
Original file line number Diff line number Diff line change 1414import org .junit .Test ;
1515
1616import java .util .List ;
17+ import java .util .regex .Pattern ;
1718
1819import static org .junit .Assert .assertEquals ;
1920import static org .junit .Assert .assertTrue ;
@@ -223,7 +224,7 @@ public void testGetSessionVideo() {
223224
224225 String videoUrl1 = sessions .get (0 ).getVideoUrl ();
225226 String videoUrl2 = automateClient .getSessionVideo (sessions .get (0 ).getId ());
226- assertEquals (videoUrl1 , videoUrl2 );
227+ assertEquals (videoUrl1 . split ( Pattern . quote ( "?" ))[ 0 ] , videoUrl2 . split ( Pattern . quote ( "?" ))[ 0 ] );
227228 } catch (BuildNotFound e ) {
228229 assertTrue (false );
229230 } catch (SessionNotFound e ) {
You can’t perform that action at this time.
0 commit comments