diff --git a/jenkins-client-it-docker/pom.xml b/jenkins-client-it-docker/pom.xml index 977fb045..72752fee 100644 --- a/jenkins-client-it-docker/pom.xml +++ b/jenkins-client-it-docker/pom.xml @@ -102,20 +102,7 @@ - - http://127.0.0.1:8080 - - - - - env.TRAVIS - - - - http://127.0.0.1:8080/ - - run-docker-its diff --git a/jenkins-client-it-docker/src/test/java/com/offbytwo/jenkins/integration/Constant.java b/jenkins-client-it-docker/src/test/java/com/offbytwo/jenkins/integration/Constant.java index 12961c4e..400a85ac 100644 --- a/jenkins-client-it-docker/src/test/java/com/offbytwo/jenkins/integration/Constant.java +++ b/jenkins-client-it-docker/src/test/java/com/offbytwo/jenkins/integration/Constant.java @@ -6,10 +6,8 @@ public final class Constant { /** * The URL for the running Jenkins server (currently a Docker image). On - * travis it is localhost (127.0.0.1) on my machine it is different. At the - * moment it is solved by a profile in pom..but could that somehow - * identified by docker itself ? + * travis it is localhost (127.0.0.1). */ - public static final URI JENKINS_URI = URI.create(System.getProperty("docker.container.network")); + public static final URI JENKINS_URI = URI.create("http://127.0.0.1:8080/"); } diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java index 0ae72b67..b9147ad3 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java @@ -188,11 +188,12 @@ public Map getViews() throws IOException { * @throws IOException in case of an error. */ public Map getViews(FolderJob folder) throws IOException { - List views = client.get(toBaseUrl(folder), MainView.class).getViews(); + // This is much better than using &depth=2 + // http://localhost:8080/api/json?pretty&tree=views[name,url,jobs[name,url]] + List views = client.get(toBaseUrl(folder) + "?tree=views[name,url,jobs[name,url]]", MainView.class).getViews(); return Maps.uniqueIndex(views, new Function() { @Override public String apply(View view) { - view.setClient(client); // TODO: Think about the following? Does there exists a // simpler/more elegant method?