Skip to content

Commit

Permalink
- cleanup a bit the url
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadeck committed Jan 15, 2018
1 parent fe1660a commit fa00e34
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/test/java/hudson/plugins/release/TestReleaseWrapper.java
Expand Up @@ -55,11 +55,12 @@ public void ensurePostIsRequiredForSubmit() throws Exception {

FreeStyleProject job = j.createFreeStyleProject("test");
String submitUrl = job.getShortUrl() + "release/submit";
URL releaseSubmitUrl = new URL(j.getURL() + submitUrl);
URL absoluteSubmitUrl = new URL(j.getURL() + submitUrl);
WebRequest postSubmit = new WebRequest(absoluteSubmitUrl, HttpMethod.POST);

// the release plugin is not activated yet, so the page does not exist for the moment
try {
wc.getPage(new WebRequest(releaseSubmitUrl, HttpMethod.POST));
wc.getPage(postSubmit);
fail();
} catch (FailingHttpStatusCodeException e) {
assertEquals(HttpStatus.SC_NOT_FOUND, e.getStatusCode());
Expand All @@ -81,7 +82,7 @@ public void ensurePostIsRequiredForSubmit() throws Exception {
}

// the POST method must be used to submit a form
Page successSubmit = wc.getPage(new WebRequest(new URL(j.getURL() + submitUrl), HttpMethod.POST));
Page successSubmit = wc.getPage(postSubmit);
Assert.assertEquals(HttpStatus.SC_OK, successSubmit.getWebResponse().getStatusCode());
}
}

0 comments on commit fa00e34

Please sign in to comment.