Skip to content

Commit

Permalink
Clarify new semantic of #getUrl
Browse files Browse the repository at this point in the history
Amends jenkinsci#348, as it broke semantic of #getUrl which now must be called
after starting Jenkins.
  • Loading branch information
Vlatombe committed Aug 16, 2022
1 parent 9816b37 commit 590098e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,12 @@ public <T extends Serializable> T then(Step2<T> s) throws Throwable {
}

/**
* Like {@link JenkinsRule#getURL} but does not require Jenkins to have been started yet.
* Similar to {@link JenkinsRule#getURL}. Requires Jenkins to be started before using {@link #startJenkins()}.
*/
public URL getUrl() throws MalformedURLException {
if (port == 0) {
throw new IllegalStateException("This method must be called after calling #startJenkins.");
}
return new URL("http://" + host + ":" + port + "/jenkins/");
}

Expand Down

0 comments on commit 590098e

Please sign in to comment.