未验证 提交 5e275dbc 编写于 作者: S StefanSpieker 提交者: GitHub

Apply suggestions from code review

Replaced instance calls with static calls as suggested by daniel-beck.
Co-Authored-By: NDaniel Beck <1831569+daniel-beck@users.noreply.github.com>
上级 35dedaf9
......@@ -80,7 +80,7 @@ public class CancelQuietDownCommandTest {
@Test
public void cancelQuietDownShouldSuccessOnQuietDownedJenkins() throws Exception {
j.jenkins.get().doQuietDown();
j.jenkins.doQuietDown();
QuietDownCommandTest.assertJenkinsInQuietMode(j);
final CLICommandInvoker.Result result = command
.authorizedTo(Jenkins.READ, Jenkins.ADMINISTER)
......@@ -133,7 +133,7 @@ public class CancelQuietDownCommandTest {
Future<FreeStyleBuild> build = OnlineNodeCommandTest.startBlockingAndFinishingBuild(project, finish);
assertThat(((FreeStyleProject) j.jenkins.getItem("aProject")).getBuilds(), hasSize(1));
assertThat(project.isBuilding(), equalTo(true));
j.jenkins.get().doQuietDown();
j.jenkins.doQuietDown();
QuietDownCommandTest.assertJenkinsInQuietMode(j);
final CLICommandInvoker.Result result = command
......@@ -157,4 +157,4 @@ public class CancelQuietDownCommandTest {
j.assertBuildStatusSuccess(build);
QuietDownCommandTest.assertJenkinsNotInQuietMode(j);
}
}
\ No newline at end of file
}
......@@ -174,7 +174,7 @@ public class ConnectNodeCommandTest {
}
@Test public void connectNodeShouldSucceedOnMaster() throws Exception {
final Computer masterComputer = j.jenkins.get().getComputer("");
final Computer masterComputer = j.jenkins.getComputer("");
CLICommandInvoker.Result result = command
.authorizedTo(Computer.CONNECT, Jenkins.READ)
......
......@@ -287,7 +287,7 @@ public class OnlineNodeCommandTest {
}
@Test public void onlineNodeShouldSucceedOnMaster() throws Exception {
final Computer masterComputer = j.jenkins.get().getComputer("");
final Computer masterComputer = j.jenkins.getComputer("");
CLICommandInvoker.Result result = command
.authorizedTo(Computer.CONNECT, Jenkins.READ)
......
......@@ -484,7 +484,7 @@ public class QuietDownCommandTest {
public static final void assertJenkinsInQuietMode(final JenkinsRule j) {
await().pollInterval(250, TimeUnit.MILLISECONDS)
.atMost(10, TimeUnit.SECONDS)
.until(() -> j.jenkins.get().getQueue().isBlockedByShutdown(task));
.until(() -> j.jenkins.getQueue().isBlockedByShutdown(task));
}
/**
......@@ -494,6 +494,6 @@ public class QuietDownCommandTest {
public static final void assertJenkinsNotInQuietMode(final JenkinsRule j) {
await().pollInterval(250, TimeUnit.MILLISECONDS)
.atMost(10, TimeUnit.SECONDS)
.until(() -> !j.jenkins.get().getQueue().isBlockedByShutdown(task));
.until(() -> !j.jenkins.getQueue().isBlockedByShutdown(task));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册