Skip to content

Commit b3faa7e

Browse files
committed
[SUREFIRE-1345] - Rename to hasFlakes and make list immutable
1 parent 1e8696b commit b3faa7e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.apache.maven.plugins.surefire.report;
2020

2121
import java.util.ArrayList;
22+
import java.util.Collections;
2223
import java.util.List;
2324

2425
import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
@@ -168,7 +169,7 @@ public boolean hasSkipped() {
168169
return hasSkipped;
169170
}
170171

171-
public boolean hasFlake() {
172+
public boolean hasFlakes() {
172173
return !flakyErrors.isEmpty() || !flakyFailures.isEmpty();
173174
}
174175

@@ -177,15 +178,15 @@ public void addFlakyError(FlakyError flakyError) {
177178
}
178179

179180
public List<FlakyError> getFlakyErrors() {
180-
return flakyErrors;
181+
return Collections.unmodifiableList(flakyErrors);
181182
}
182183

183184
public void addFlakyFailure(FlakyFailure flakyFailure) {
184185
flakyFailures.add(flakyFailure);
185186
}
186187

187188
public List<FlakyFailure> getFlakyFailures() {
188-
return flakyFailures;
189+
return Collections.unmodifiableList(flakyFailures);
189190
}
190191

191192
/**

surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ public void shouldParseFlakes() throws Exception {
744744
assertThat(tests.get(0).getTime(), is(0.034f));
745745
assertThat(tests.get(0).getFullName(), is("org.acme.FlakyTest.testFlaky"));
746746
assertThat(tests.get(0).hasError(), is(false));
747-
assertThat(tests.get(0).hasFlake(), is(true));
747+
assertThat(tests.get(0).hasFlakes(), is(true));
748748

749749
List<FlakyFailure> flakyFailures = tests.get(0).getFlakyFailures();
750750
assertThat(flakyFailures.size(), is(3));
@@ -781,6 +781,6 @@ public void shouldParseFlakes() throws Exception {
781781
assertThat(tests.get(1).getTime(), is(0.001f));
782782
assertThat(tests.get(1).getFullName(), is("org.acme.FlakyTest.testStable"));
783783
assertThat(tests.get(1).hasError(), is(false));
784-
assertThat(tests.get(1).hasFlake(), is(false));
784+
assertThat(tests.get(1).hasFlakes(), is(false));
785785
}
786786
}

0 commit comments

Comments
 (0)