mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
Failure to define a crumb was causing testDeleteHudsonComputer to be testing the wrong thing.
This commit is contained in:
1 parent
d33e22d392
commit
f44ed3d3e1
1 file changed
+3
-3
@@ -44,8 +44,8 @@ import org.jvnet.hudson.test.Email;
|
||||
import org.jvnet.hudson.test.HudsonTestCase;
|
||||
import org.jvnet.hudson.test.recipes.LocalData;
|
||||
|
||||
import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
@@ -152,10 +152,10 @@ public class HudsonTest extends HudsonTestCase {
|
||||
// try to delete it by hitting the final URL directly
|
||||
WebRequestSettings req = new WebRequestSettings(new URL(wc.getContextPath()+"computer/(master)/doDelete"), HttpMethod.POST);
|
||||
try {
|
||||
wc.getPage(req);
|
||||
wc.getPage(wc.addCrumb(req));
|
||||
fail("Error code expected");
|
||||
} catch (FailingHttpStatusCodeException e) {
|
||||
assertEquals(SC_FORBIDDEN,e.getStatusCode());
|
||||
assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, e.getStatusCode());
|
||||
}
|
||||
|
||||
// the master computer object should be still here
|
||||
|
||||
Reference in new issue
Block a user