提交 516a4e52 编写于 作者: T tfennelly

Fixed UserTest tests

上级 a3e7c632
......@@ -24,7 +24,7 @@
*/
package hudson.model;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.ScriptException;
import com.gargoylesoftware.htmlunit.WebAssert;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
......@@ -51,11 +51,12 @@ import org.acegisecurity.context.SecurityContextHolder;
import static org.junit.Assert.*;
import static org.junit.Assume.*;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.FakeChangeLogSCM;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;
import org.jvnet.hudson.test.recipes.LocalData;
......@@ -450,8 +451,9 @@ public class UserTest {
j.submit(form);
fail("User should not be able to delete himself");
}
catch(FailingHttpStatusCodeException e){
catch(ScriptException e){
//ok exception should be thrown
Assert.assertTrue(e.getMessage().startsWith("400"));
}
assertTrue("User should not delete himself from memory.", User.getAll().contains(user));
assertTrue("User should not delete his persistent data.", user.getConfigFile().exists());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册