Skip to content

Commit 2bfc356

Browse files
committed
Use JUnit 5 convention for test method visibility
1 parent 7fed883 commit 2bfc356

File tree

219 files changed

+4133
-4133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+4133
-4133
lines changed

src/test/java/org/apache/commons/lang3/AnnotationUtilsTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -405,24 +405,24 @@ public void setup() throws Exception {
405405
}
406406

407407
@Test
408-
public void testAnnotationsOfDifferingTypes() {
408+
void testAnnotationsOfDifferingTypes() {
409409
assertFalse(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field4.getAnnotation(NestAnnotation.class)));
410410
assertFalse(AnnotationUtils.equals(field4.getAnnotation(NestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
411411
}
412412

413413
@Test
414-
public void testBothArgsNull() {
414+
void testBothArgsNull() {
415415
assertTrue(AnnotationUtils.equals(null, null));
416416
}
417417

418418
@Test
419-
public void testEquivalence() {
419+
void testEquivalence() {
420420
assertTrue(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field2.getAnnotation(TestAnnotation.class)));
421421
assertTrue(AnnotationUtils.equals(field2.getAnnotation(TestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
422422
}
423423

424424
@Test
425-
public void testGeneratedAnnotationEquivalentToRealAnnotation() {
425+
void testGeneratedAnnotationEquivalentToRealAnnotation() {
426426
assertTimeoutPreemptively(Duration.ofSeconds(666L), () -> {
427427
final Test real = getClass().getDeclaredMethod(
428428
"testGeneratedAnnotationEquivalentToRealAnnotation").getAnnotation(Test.class);
@@ -459,7 +459,7 @@ public void testGeneratedAnnotationEquivalentToRealAnnotation() {
459459
}
460460

461461
@Test
462-
public void testHashCode() {
462+
void testHashCode() {
463463
assertTimeoutPreemptively(Duration.ofSeconds(666L), () -> {
464464
final Test test = getClass().getDeclaredMethod("testHashCode").getAnnotation(Test.class);
465465
assertEquals(test.hashCode(), AnnotationUtils.hashCode(test));
@@ -471,7 +471,7 @@ public void testHashCode() {
471471
}
472472

473473
@Test
474-
public void testIsValidAnnotationMemberType() {
474+
void testIsValidAnnotationMemberType() {
475475
for (final Class<?> type : new Class[] { byte.class, short.class, int.class, char.class,
476476
long.class, float.class, double.class, boolean.class, String.class, Class.class,
477477
NestAnnotation.class, TestAnnotation.class, Stooge.class, ElementType.class }) {
@@ -487,25 +487,25 @@ public void testIsValidAnnotationMemberType() {
487487
}
488488

489489
@Test
490-
public void testNonEquivalentAnnotationsOfSameType() {
490+
void testNonEquivalentAnnotationsOfSameType() {
491491
assertFalse(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field3.getAnnotation(TestAnnotation.class)));
492492
assertFalse(AnnotationUtils.equals(field3.getAnnotation(TestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
493493
}
494494

495495
@Test
496-
public void testOneArgNull() {
496+
void testOneArgNull() {
497497
assertFalse(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), null));
498498
assertFalse(AnnotationUtils.equals(null, field1.getAnnotation(TestAnnotation.class)));
499499
}
500500

501501
@Test
502-
public void testSameInstance() {
502+
void testSameInstance() {
503503
assertTrue(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
504504
}
505505

506506
@Test
507507
@TestMethodAnnotation(timeout = 666000)
508-
public void testToString() {
508+
void testToString() {
509509
assertTimeoutPreemptively(Duration.ofSeconds(666L), () -> {
510510
final TestMethodAnnotation testAnnotation =
511511
getClass().getDeclaredMethod("testToString").getAnnotation(TestMethodAnnotation.class);

src/test/java/org/apache/commons/lang3/AppendableJoinerTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void render(final Appendable appendable) throws IOException {
5555
}
5656

5757
@Test
58-
public void testAllBuilderPropertiesStringBuilder() {
58+
void testAllBuilderPropertiesStringBuilder() {
5959
// @formatter:off
6060
final AppendableJoiner<Object> joiner = AppendableJoiner.builder()
6161
.setPrefix("<")
@@ -71,7 +71,7 @@ public void testAllBuilderPropertiesStringBuilder() {
7171
}
7272

7373
@Test
74-
public void testBuildDefaultStringBuilder() {
74+
void testBuildDefaultStringBuilder() {
7575
final Builder<Object> builder = AppendableJoiner.builder();
7676
assertNotSame(builder.get(), builder.get());
7777
final AppendableJoiner<Object> joiner = builder.get();
@@ -82,14 +82,14 @@ public void testBuildDefaultStringBuilder() {
8282
}
8383

8484
@Test
85-
public void testBuilder() {
85+
void testBuilder() {
8686
assertNotSame(AppendableJoiner.builder(), AppendableJoiner.builder());
8787
}
8888

8989
@SuppressWarnings("deprecation") // Test own StrBuilder
9090
@ParameterizedTest
9191
@ValueSource(classes = { StringBuilder.class, StringBuffer.class, StringWriter.class, StrBuilder.class, TextStringBuilder.class })
92-
public void testDelimiterAppendable(final Class<? extends Appendable> clazz) throws Exception {
92+
void testDelimiterAppendable(final Class<? extends Appendable> clazz) throws Exception {
9393
final AppendableJoiner<Object> joiner = AppendableJoiner.builder().setDelimiter(".").get();
9494
final Appendable sbuilder = clazz.newInstance();
9595
sbuilder.append("A");
@@ -101,7 +101,7 @@ public void testDelimiterAppendable(final Class<? extends Appendable> clazz) thr
101101
}
102102

103103
@Test
104-
public void testDelimiterStringBuilder() {
104+
void testDelimiterStringBuilder() {
105105
final AppendableJoiner<Object> joiner = AppendableJoiner.builder().setDelimiter(".").get();
106106
final StringBuilder sbuilder = new StringBuilder("A");
107107
// does not throw IOException
@@ -112,7 +112,7 @@ public void testDelimiterStringBuilder() {
112112
}
113113

114114
@Test
115-
public void testToCharSequenceStringBuilder1() {
115+
void testToCharSequenceStringBuilder1() {
116116
// @formatter:off
117117
final AppendableJoiner<Object> joiner = AppendableJoiner.builder()
118118
.setPrefix("<")
@@ -128,7 +128,7 @@ public void testToCharSequenceStringBuilder1() {
128128
}
129129

130130
@Test
131-
public void testToCharSequenceStringBuilder2() {
131+
void testToCharSequenceStringBuilder2() {
132132
// @formatter:off
133133
final AppendableJoiner<Fixture> joiner = AppendableJoiner.<Fixture>builder()
134134
.setElementAppender((a, e) -> e.render(a))

src/test/java/org/apache/commons/lang3/ArchUtilsTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void assertNotEqualsTypeNotNull(final Processor.Type type, final Process
6868
}
6969

7070
@Test
71-
public void testArch() {
71+
void testArch() {
7272
Processor processor = ArchUtils.getProcessor(X86);
7373
assertEqualsTypeNotNull(Processor.Type.X86, processor);
7474
assertTrue(processor.isX86());
@@ -113,15 +113,15 @@ public void testArch() {
113113
}
114114

115115
@Test
116-
public void testArchLabels() {
116+
void testArchLabels() {
117117
for (final Arch arch : Arch.values()) {
118118
// Only test label presence.
119119
assertFalse(arch.getLabel().isEmpty());
120120
}
121121
}
122122

123123
@Test
124-
public void testGetProcessor() {
124+
void testGetProcessor() {
125125
assertNotNull(ArchUtils.getProcessor(X86));
126126
assertNull(ArchUtils.getProcessor("NA"));
127127
assertNull(ArchUtils.getProcessor(null));
@@ -131,7 +131,7 @@ public void testGetProcessor() {
131131
}
132132

133133
@Test
134-
public void testIs32BitJVM() {
134+
void testIs32BitJVM() {
135135
Processor processor = ArchUtils.getProcessor(X86);
136136
assertEqualsArchNotNull(Processor.Arch.BIT_32, processor);
137137
assertTrue(processor.is32Bit());
@@ -166,7 +166,7 @@ public void testIs32BitJVM() {
166166
}
167167

168168
@Test
169-
public void testIs64BitJVM() {
169+
void testIs64BitJVM() {
170170
Processor processor = ArchUtils.getProcessor(X86_64);
171171
assertEqualsArchNotNull(Processor.Arch.BIT_64, processor);
172172
assertTrue(processor.is64Bit());
@@ -207,7 +207,7 @@ public void testIs64BitJVM() {
207207
}
208208

209209
@Test
210-
public void testTypeLabels() {
210+
void testTypeLabels() {
211211
for (final Type type : Type.values()) {
212212
// Only test label presence.
213213
assertFalse(type.getLabel().isEmpty());

src/test/java/org/apache/commons/lang3/ArrayFillTest.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class ArrayFillTest extends AbstractLangTest {
3232

3333
@Test
34-
public void testFillBooleanArray() {
34+
void testFillBooleanArray() {
3535
final boolean[] array = new boolean[3];
3636
final boolean val = true;
3737
final boolean[] actual = ArrayFill.fill(array, val);
@@ -42,15 +42,15 @@ public void testFillBooleanArray() {
4242
}
4343

4444
@Test
45-
public void testFillBooleanArrayNull() {
45+
void testFillBooleanArrayNull() {
4646
final boolean[] array = null;
4747
final boolean val = true;
4848
final boolean[] actual = ArrayFill.fill(array, val);
4949
assertSame(array, actual);
5050
}
5151

5252
@Test
53-
public void testFillByteArray() {
53+
void testFillByteArray() {
5454
final byte[] array = new byte[3];
5555
final byte val = (byte) 1;
5656
final byte[] actual = ArrayFill.fill(array, val);
@@ -61,15 +61,15 @@ public void testFillByteArray() {
6161
}
6262

6363
@Test
64-
public void testFillByteArrayNull() {
64+
void testFillByteArrayNull() {
6565
final byte[] array = null;
6666
final byte val = (byte) 1;
6767
final byte[] actual = ArrayFill.fill(array, val);
6868
assertSame(array, actual);
6969
}
7070

7171
@Test
72-
public void testFillCharArray() {
72+
void testFillCharArray() {
7373
final char[] array = new char[3];
7474
final char val = 1;
7575
final char[] actual = ArrayFill.fill(array, val);
@@ -80,15 +80,15 @@ public void testFillCharArray() {
8080
}
8181

8282
@Test
83-
public void testFillCharArrayNull() {
83+
void testFillCharArrayNull() {
8484
final char[] array = null;
8585
final char val = 1;
8686
final char[] actual = ArrayFill.fill(array, val);
8787
assertSame(array, actual);
8888
}
8989

9090
@Test
91-
public void testFillDoubleArray() {
91+
void testFillDoubleArray() {
9292
final double[] array = new double[3];
9393
final double val = 1;
9494
final double[] actual = ArrayFill.fill(array, val);
@@ -99,15 +99,15 @@ public void testFillDoubleArray() {
9999
}
100100

101101
@Test
102-
public void testFillDoubleArrayNull() {
102+
void testFillDoubleArrayNull() {
103103
final double[] array = null;
104104
final double val = 1;
105105
final double[] actual = ArrayFill.fill(array, val);
106106
assertSame(array, actual);
107107
}
108108

109109
@Test
110-
public void testFillFloatArray() {
110+
void testFillFloatArray() {
111111
final float[] array = new float[3];
112112
final float val = 1;
113113
final float[] actual = ArrayFill.fill(array, val);
@@ -118,15 +118,15 @@ public void testFillFloatArray() {
118118
}
119119

120120
@Test
121-
public void testFillFloatArrayNull() {
121+
void testFillFloatArrayNull() {
122122
final float[] array = null;
123123
final float val = 1;
124124
final float[] actual = ArrayFill.fill(array, val);
125125
assertSame(array, actual);
126126
}
127127

128128
@Test
129-
public void testFillFunction() throws Exception {
129+
void testFillFunction() throws Exception {
130130
final FailableIntFunction<?, Exception> nullIntFunction = null;
131131
assertNull(ArrayFill.fill(null, nullIntFunction));
132132
assertArrayEquals(null, ArrayFill.fill(null, nullIntFunction));
@@ -141,7 +141,7 @@ public void testFillFunction() throws Exception {
141141
}
142142

143143
@Test
144-
public void testFillIntArray() {
144+
void testFillIntArray() {
145145
final int[] array = new int[3];
146146
final int val = 1;
147147
final int[] actual = ArrayFill.fill(array, val);
@@ -152,15 +152,15 @@ public void testFillIntArray() {
152152
}
153153

154154
@Test
155-
public void testFillIntArrayNull() {
155+
void testFillIntArrayNull() {
156156
final int[] array = null;
157157
final int val = 1;
158158
final int[] actual = ArrayFill.fill(array, val);
159159
assertSame(array, actual);
160160
}
161161

162162
@Test
163-
public void testFillLongArray() {
163+
void testFillLongArray() {
164164
final long[] array = new long[3];
165165
final long val = 1;
166166
final long[] actual = ArrayFill.fill(array, val);
@@ -171,15 +171,15 @@ public void testFillLongArray() {
171171
}
172172

173173
@Test
174-
public void testFillLongArrayNull() {
174+
void testFillLongArrayNull() {
175175
final long[] array = null;
176176
final long val = 1;
177177
final long[] actual = ArrayFill.fill(array, val);
178178
assertSame(array, actual);
179179
}
180180

181181
@Test
182-
public void testFillObjectArray() {
182+
void testFillObjectArray() {
183183
final String[] array = new String[3];
184184
final String val = "A";
185185
final String[] actual = ArrayFill.fill(array, val);
@@ -190,15 +190,15 @@ public void testFillObjectArray() {
190190
}
191191

192192
@Test
193-
public void testFillObjectArrayNull() {
193+
void testFillObjectArrayNull() {
194194
final Object[] array = null;
195195
final Object val = 1;
196196
final Object[] actual = ArrayFill.fill(array, val);
197197
assertSame(array, actual);
198198
}
199199

200200
@Test
201-
public void testFillShortArray() {
201+
void testFillShortArray() {
202202
final short[] array = new short[3];
203203
final short val = (byte) 1;
204204
final short[] actual = ArrayFill.fill(array, val);
@@ -209,7 +209,7 @@ public void testFillShortArray() {
209209
}
210210

211211
@Test
212-
public void testFillShortArrayNull() {
212+
void testFillShortArrayNull() {
213213
final short[] array = null;
214214
final short val = 1;
215215
final short[] actual = ArrayFill.fill(array, val);

0 commit comments

Comments
 (0)