Change builder method to build() for consistency

This commit is contained in:
Greg Schueler 2013-08-06 12:25:18 -07:00
parent 2b86c4bffd
commit 94ea9bca77
4 changed files with 12 additions and 12 deletions

View file

@ -47,7 +47,7 @@ public class RunAdhocCommandBuilder {
return this;
}
public RunAdhocCommand create() {
public RunAdhocCommand build() {
DefaultRunAdhocCommand built = command;
command = new DefaultRunAdhocCommand();
return built;

View file

@ -36,7 +36,7 @@ public class RunJobBuilder {
return this;
}
public RunJob create() {
public RunJob build() {
RunJob built = jobRun;
jobRun = new DefaultRunJob();
return built;

View file

@ -1034,7 +1034,7 @@ public class RundeckClient implements Serializable {
.setOptions(options)
.setNodeFilters(nodeFilters)
.setAsUser(asUser)
.create());
.build());
}
/**
* Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the
@ -1227,7 +1227,7 @@ public class RundeckClient implements Serializable {
.setOptions(options)
.setNodeFilters(nodeFilters)
.setAsUser(asUser)
.create(), poolingInterval, poolingUnit);
.build(), poolingInterval, poolingUnit);
}
/**
@ -1368,7 +1368,7 @@ public class RundeckClient implements Serializable {
.setNodeThreadcount(nodeThreadcount)
.setNodeKeepgoing(nodeKeepgoing)
.setAsUser(asUser)
.create());
.build());
}
/**
* Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution).
@ -1614,7 +1614,7 @@ public class RundeckClient implements Serializable {
.setNodeThreadcount(nodeThreadcount)
.setNodeKeepgoing(nodeKeepgoing)
.setAsUser(asUser)
.create(), poolingInterval, poolingUnit);
.build(), poolingInterval, poolingUnit);
}
/**
* Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck

View file

@ -372,7 +372,7 @@ public class RundeckClientTest {
RundeckClient client = createClient(TEST_TOKEN_3, 5);
final RundeckExecution test
= client.triggerJob(RunJobBuilder.builder().setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9").create());
= client.triggerJob(RunJobBuilder.builder().setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9").build());
Assert.assertEquals((Long) 19L, test.getId());
Assert.assertEquals(null, test.getArgstring());
@ -407,7 +407,7 @@ public class RundeckClientTest {
= client.triggerJob(RunJobBuilder.builder()
.setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9")
.setAsUser("api-java-client-user-test1")
.create());
.build());
Assert.assertEquals((Long)20L, test.getId());
Assert.assertEquals(null, test.getArgstring());
@ -440,7 +440,7 @@ public class RundeckClientTest {
test = client.triggerJob(RunJobBuilder.builder()
.setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9")
.setAsUser("api-java-client-user-test2")
.create());
.build());
Assert.fail("should not succeed");
} catch (RundeckApiException e) {
Assert.assertEquals("Not authorized for action \"Run as User\" for Job ID 3170ba0e-6093-4b58-94d2-52988aefbfc9", e.getMessage());
@ -472,7 +472,7 @@ public class RundeckClientTest {
= client.triggerAdhocCommand(RunAdhocCommandBuilder.builder()
.setProject("test")
.setCommand("echo test trigger_adhoc_command")
.create());
.build());
Assert.assertEquals((Long) 23L, test.getId());
Assert.assertEquals(null, test.getArgstring());
@ -508,7 +508,7 @@ public class RundeckClientTest {
.setProject("test")
.setCommand("echo test trigger_adhoc_command_as_user")
.setAsUser("api-java-client-test-run-command-as-user1")
.create()
.build()
);
Assert.assertEquals((Long) 24L, test.getId());
@ -543,7 +543,7 @@ public class RundeckClientTest {
.setProject("test")
.setCommand("echo test trigger_adhoc_command_as_user")
.setAsUser("api-java-client-test-run-command-as-user1")
.create()
.build()
);
Assert.fail("should not succeed");
} catch (RundeckApiException e) {