Skip to content

Commit

Permalink
Rename ClearRunIdIncrementer factory method
Browse files Browse the repository at this point in the history
  • Loading branch information
acktsap committed Oct 28, 2022
1 parent 38b7306 commit 936e949
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class ClearRunIdIncrementer implements JobParametersIncrementer {
* Create a new ClearRunIdIncrementer with {{@link #DEFAULT_RUN_ID}}.
* @return a new ClearRunIdIncrementer instance
*/
public static ClearRunIdIncrementer of() {
return of(DEFAULT_RUN_ID);
public static ClearRunIdIncrementer create() {
return create(DEFAULT_RUN_ID);
}

/**
Expand All @@ -51,7 +51,7 @@ public static ClearRunIdIncrementer of() {
* @param runId a run id
* @return a new ClearRunIdIncrementer instance
*/
public static ClearRunIdIncrementer of(String runId) {
public static ClearRunIdIncrementer create(String runId) {
return new ClearRunIdIncrementer(runId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ClearRunIdIncrementerTest {
@Test
void testGetNextReturnsOneWhenNoPreviousOne() {
// given
ClearRunIdIncrementer clearRunIdIncrementer = ClearRunIdIncrementer.of();
ClearRunIdIncrementer clearRunIdIncrementer = ClearRunIdIncrementer.create();

// when
JobParameters jobParameters = clearRunIdIncrementer.getNext(new JobParameters());
Expand All @@ -45,7 +45,7 @@ void testGetNextReturnsOneWhenNoPreviousOne() {
@Test
void testGetNextReturnsNextValue() {
// given
ClearRunIdIncrementer clearRunIdIncrementer = ClearRunIdIncrementer.of();
ClearRunIdIncrementer clearRunIdIncrementer = ClearRunIdIncrementer.create();

// when
long previousId = ThreadLocalRandom.current().nextLong();
Expand All @@ -62,7 +62,7 @@ void testGetNextReturnsNextValue() {
void testCustomRunId() {
// given
String runId = UUID.randomUUID().toString();
ClearRunIdIncrementer clearRunIdIncrementer = ClearRunIdIncrementer.of(runId);
ClearRunIdIncrementer clearRunIdIncrementer = ClearRunIdIncrementer.create(runId);

// when
long previousId = ThreadLocalRandom.current().nextLong();
Expand Down

0 comments on commit 936e949

Please sign in to comment.