未验证 提交 b3f6ca61 编写于 作者: O Oleg Nenashev 提交者: GitHub

[JENKINS-52181] - Fix the unit test

上级 ba395a1a
......@@ -84,13 +84,20 @@ public class ConsoleCommandTest {
@Issue("JENKINS-52181")
@Test public void consoleShouldBeAccessibleForUserWithRead() throws Exception {
j.createFreeStyleProject("aProject");
FreeStyleProject project = j.createFreeStyleProject("aProject");
if (Functions.isWindows()) {
project.getBuildersList().add(new BatchFile("echo 1"));
} else {
project.getBuildersList().add(new Shell("echo 1"));
}
assertThat(project.scheduleBuild2(0).get().getLog(), containsString("echo 1"));
final CLICommandInvoker.Result result = command
.authorizedTo(Jenkins.READ, Job.READ)
.invokeWithArgs("aProject");
assertThat(result, succeeded());
assertThat(result.stdout(), containsString("echo 5"));
assertThat(result.stdout(), containsString("echo 1"));
}
@Test public void consoleShouldFailWhenProjectDoesNotExist() throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册