Skip to content

Commit

Permalink
feat(new-rocket-api): Let integration tests respect RocketChat versio…
Browse files Browse the repository at this point in the history
…n (see #JENKINS-40595 and #JENKINS-40673)
  • Loading branch information
hypery2k committed Dec 27, 2016
1 parent 0cd495d commit aa9614f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
import sun.security.validator.ValidatorException;

import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;

/**
* Created by mreinhardt on 26.12.16.
Expand Down Expand Up @@ -163,6 +160,6 @@ public User getUser(String userId) throws IOException {

@Override
public Room[] getChannels() throws IOException {
return new Room[0];
return this.getPublicRooms().toArray(new Room[0]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ public class RocketChatClientIT {

@Before
public void setup() throws Exception {
this.client = new RocketChatClientImpl("http://localhost:4443/api/", "admin", "supersecret"); // TODO read from env
String rocketVersionString = System.getProperty("rocket.version", "0.48.2");
int rocketVersion = Integer.parseInt(rocketVersionString.split("\\.")[1]);
if (rocketVersion >= 48) {
this.client = new RocketChatClientImpl("http://localhost:4443/api/", "admin", "supersecret"); // TODO read from env
} else {
this.client = new LegacyRocketChatClient("http://localhost:4443/api/", "admin", "supersecret");
}
}

@Test
Expand Down

0 comments on commit aa9614f

Please sign in to comment.