Skip to content

Commit 6f01959

Browse files
author
Nurgul Amat
committed
Refactor: minor code cleanup and corrections
1 parent 6a4d3b7 commit 6f01959

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/main/java/pl/damianszczepanik/jenkins/buildhistorymanager/model/conditions/Condition.java

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public abstract class Condition extends AbstractDescribableImpl<Condition> {
1515

1616
/**
1717
* Decides if the build matches given criteria to be updated or not.
18+
*
1819
* @param run build which should be evaluated
1920
* @param configuration configuration from the role
2021
* @param buildPosition the position of the build in the build history
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p><b>Description</b></p>
2-
<p>Build position in build history ....</p>
2+
<p>TODO</p>
33

44
<p><b>Use cases</b></p>
5-
<p>???</p>
5+
<p>TODO</p>
66

77
<p><b>Warning!</b></p>
8-
<p>???</p>
8+
<p>TODO</p>

src/test/java/pl/damianszczepanik/jenkins/buildhistorymanager/model/RuleTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
public class RuleTest {
2424

25-
public static int buildPosition = 0;
25+
public static final int FIRST_BUILD_POSITION = 0;
2626

2727
@Test
2828
public void getConditions_ReturnsConditions() {
@@ -103,7 +103,7 @@ public void validateConditions_MatchesAllConditions() {
103103
Run<?, ?> run = mock(Run.class);
104104

105105
// when
106-
rule.validateConditions(run, buildPosition);
106+
rule.validateConditions(run, FIRST_BUILD_POSITION);
107107

108108
// then
109109
for (Condition condition : rule.getConditions()) {
@@ -119,7 +119,7 @@ public void validateConditions_OnNegativeCondition_DoesNotIncrementMatchedTimes(
119119
Run<?, ?> run = mock(Run.class);
120120

121121
// when
122-
rule.validateConditions(run, buildPosition);
122+
rule.validateConditions(run, FIRST_BUILD_POSITION);
123123

124124
// then
125125
int matchedTimes = Deencapsulation.getField(rule, "matchedTimes");
@@ -151,8 +151,8 @@ public void validateConditions_PerformsNTimes() throws IOException, InterruptedE
151151
Run<?, ?> run = mock(Run.class);
152152

153153
// when
154-
rule.validateConditions(run, buildPosition);
155-
rule.validateConditions(run, buildPosition);
154+
rule.validateConditions(run, FIRST_BUILD_POSITION);
155+
rule.validateConditions(run, FIRST_BUILD_POSITION);
156156

157157
// then
158158
int matchedTimes = Deencapsulation.getField(rule, "matchedTimes");

src/test/java/pl/damianszczepanik/jenkins/buildhistorymanager/model/conditions/MatchEveryBuildConditionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void matches_ReturnsTrue() throws IOException, InterruptedException {
1818
MatchEveryBuildCondition condition = new MatchEveryBuildCondition();
1919

2020
// when
21-
boolean matches =condition.matches(null, null, 0);
21+
boolean matches = condition.matches(null, null, 0);
2222

2323
// then
2424
assertThat(matches).isTrue();

0 commit comments

Comments
 (0)