Skip to content

Commit 48afb43

Browse files
committed
Use JUnit 5 convention for test method visibility
1 parent d1a4c56 commit 48afb43

File tree

139 files changed

+507
-507
lines changed

Some content is hidden

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

139 files changed

+507
-507
lines changed

src/test/java/org/apache/commons/collections4/AbstractArrayListTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void testNewArrayList() {
4747

4848
@Test
4949
@SuppressWarnings("unchecked")
50-
public void testSearch() {
50+
void testSearch() {
5151
final ArrayList<E> list = makeObject();
5252
list.add((E) "First Item");
5353
list.add((E) "Last Item");

src/test/java/org/apache/commons/collections4/AbstractLinkedListTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public Collection<T> makeConfirmedFullCollection() {
8383
*/
8484
@Test
8585
@SuppressWarnings("unchecked")
86-
public void testLinkedListAddFirst() {
86+
void testLinkedListAddFirst() {
8787
if (!isAddSupported()) {
8888
return;
8989
}
@@ -105,7 +105,7 @@ public void testLinkedListAddFirst() {
105105
*/
106106
@Test
107107
@SuppressWarnings("unchecked")
108-
public void testLinkedListAddLast() {
108+
void testLinkedListAddLast() {
109109
if (!isAddSupported()) {
110110
return;
111111
}

src/test/java/org/apache/commons/collections4/AbstractTreeMapTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void testNewMap() {
5252

5353
@Test
5454
@SuppressWarnings("unchecked")
55-
public void testSearch() {
55+
void testSearch() {
5656
final TreeMap<K, V> map = makeObject();
5757
map.put((K) "first", (V) "First Item");
5858
map.put((K) "second", (V) "Second Item");

src/test/java/org/apache/commons/collections4/ArrayStackTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void testNewStack() {
5454

5555
@Test
5656
@SuppressWarnings("unchecked")
57-
public void testPushPeekPop() {
57+
void testPushPeekPop() {
5858
final ArrayStack<E> stack = makeObject();
5959

6060
stack.push((E) "First Item");
@@ -97,7 +97,7 @@ public void testSearch() {
9797
"Cannot find 'Missing Item'");
9898
}
9999

100-
// public void testCreate() throws Exception {
100+
// void testCreate() throws Exception {
101101
// resetEmpty();
102102
// writeExternalFormToDisk((java.io.Serializable) getCollection(), "src/test/resources/data/test/ArrayStack.emptyCollection.version4.obj");
103103
// resetFull();

src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public T transform(final T object) {
6767

6868
@Test
6969
@SuppressWarnings("unchecked")
70-
public void testChainedClosure() {
70+
void testChainedClosure() {
7171
MockClosure<Object> a = new MockClosure<>();
7272
MockClosure<Object> b = new MockClosure<>();
7373
ClosureUtils.chainedClosure(a, b).accept(null);
@@ -201,7 +201,7 @@ void testSingletonPatternInSerialization() throws ClassNotFoundException, IOExce
201201

202202
@Test
203203
@SuppressWarnings("unchecked")
204-
public void testSwitchClosure() {
204+
void testSwitchClosure() {
205205
final MockClosure<String> a = new MockClosure<>();
206206
final MockClosure<String> b = new MockClosure<>();
207207
ClosureUtils.<String>switchClosure(

src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ void testIsSubCollectionOfSelf() {
15351535

15361536
@Test
15371537
@Deprecated
1538-
public void testMatchesAll() {
1538+
void testMatchesAll() {
15391539
assertFalse(CollectionUtils.matchesAll(null, null));
15401540
assertFalse(CollectionUtils.matchesAll(collectionA, null));
15411541

@@ -2169,7 +2169,7 @@ void testSubtractWithPredicate() {
21692169

21702170
@Test
21712171
@Deprecated
2172-
public void testSynchronizedCollection() {
2172+
void testSynchronizedCollection() {
21732173
final Collection<Object> col = CollectionUtils.synchronizedCollection(new ArrayList<>());
21742174
assertInstanceOf(SynchronizedCollection.class, col, "Returned object should be a SynchronizedCollection.");
21752175

@@ -2278,7 +2278,7 @@ void testUnionNullColl2() {
22782278

22792279
@Test
22802280
@Deprecated
2281-
public void testUnmodifiableCollection() {
2281+
void testUnmodifiableCollection() {
22822282
final Collection<Object> col = CollectionUtils.unmodifiableCollection(new ArrayList<>());
22832283
assertInstanceOf(UnmodifiableCollection.class, col, "Returned object should be a UnmodifiableCollection.");
22842284

src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ void testEmptyListIterator() {
601601
*/
602602
@Test
603603
@SuppressWarnings("unchecked")
604-
public void testEmptyMapIterator() {
604+
void testEmptyMapIterator() {
605605
assertSame(EmptyMapIterator.INSTANCE, IteratorUtils.EMPTY_MAP_ITERATOR);
606606
assertTrue(IteratorUtils.EMPTY_MAP_ITERATOR instanceof Iterator);
607607
assertTrue(IteratorUtils.EMPTY_MAP_ITERATOR instanceof MapIterator);
@@ -626,7 +626,7 @@ public void testEmptyMapIterator() {
626626
*/
627627
@Test
628628
@SuppressWarnings("unchecked")
629-
public void testEmptyOrderedIterator() {
629+
void testEmptyOrderedIterator() {
630630
assertSame(EmptyOrderedIterator.INSTANCE, IteratorUtils.EMPTY_ORDERED_ITERATOR);
631631
assertTrue(IteratorUtils.EMPTY_ORDERED_ITERATOR instanceof Iterator);
632632
assertTrue(IteratorUtils.EMPTY_ORDERED_ITERATOR instanceof OrderedIterator);
@@ -649,7 +649,7 @@ public void testEmptyOrderedIterator() {
649649
*/
650650
@Test
651651
@SuppressWarnings("unchecked")
652-
public void testEmptyOrderedMapIterator() {
652+
void testEmptyOrderedMapIterator() {
653653
assertSame(EmptyOrderedMapIterator.INSTANCE, IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR);
654654
assertTrue(IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR instanceof Iterator);
655655
assertTrue(IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR instanceof MapIterator);

src/test/java/org/apache/commons/collections4/ListUtilsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public Integer transform(final Integer input) {
263263

264264
@Test
265265
@SuppressWarnings("boxing") // OK in test code
266-
public void testLongestCommonSubsequence() {
266+
void testLongestCommonSubsequence() {
267267
assertThrows(NullPointerException.class, () -> ListUtils.longestCommonSubsequence((List<?>) null, null), "failed to check for null argument");
268268
assertThrows(NullPointerException.class, () -> ListUtils.longestCommonSubsequence(Arrays.asList('A'), null), "failed to check for null argument");
269269
assertThrows(NullPointerException.class, () -> ListUtils.longestCommonSubsequence(null, Arrays.asList('A')), "failed to check for null argument");
@@ -317,7 +317,7 @@ void testLongestCommonSubsequenceWithString() {
317317

318318
@Test
319319
@SuppressWarnings("boxing") // OK in test code
320-
public void testPartition() {
320+
void testPartition() {
321321
final List<Integer> strings = new ArrayList<>();
322322
for (int i = 0; i <= 6; i++) {
323323
strings.add(i);
@@ -392,7 +392,7 @@ void testRetainAll() {
392392

393393
@Test
394394
@SuppressWarnings("boxing") // OK in test code
395-
public void testSelect() {
395+
void testSelect() {
396396
final List<Integer> list = new ArrayList<>();
397397
list.add(1);
398398
list.add(2);
@@ -410,7 +410,7 @@ public void testSelect() {
410410

411411
@Test
412412
@SuppressWarnings("boxing") // OK in test code
413-
public void testSelectRejected() {
413+
void testSelectRejected() {
414414
final List<Long> list = new ArrayList<>();
415415
list.add(1L);
416416
list.add(2L);

src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void testEmptyIfNull() {
4747

4848
@Test
4949
@SuppressWarnings({ "unchecked", "rawtypes" })
50-
public void testEmptyUnmodifiableMultiValuedMap() {
50+
void testEmptyUnmodifiableMultiValuedMap() {
5151
final MultiValuedMap map = MultiMapUtils.EMPTY_MULTI_VALUED_MAP;
5252
assertTrue(map.isEmpty());
5353

src/test/java/org/apache/commons/collections4/PredicateUtilsTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected Predicate<?> generatePredicate() {
5454

5555
@Test
5656
@SuppressWarnings("unchecked")
57-
public void testAllPredicate() {
57+
void testAllPredicate() {
5858
assertPredicateTrue(AllPredicate.allPredicate(), null);
5959
assertTrue(AllPredicate.allPredicate(TruePredicate.truePredicate(), TruePredicate.truePredicate(), TruePredicate.truePredicate()).test(null));
6060
assertFalse(AllPredicate.allPredicate(TruePredicate.truePredicate(), FalsePredicate.falsePredicate(), TruePredicate.truePredicate()).test(null));
@@ -97,7 +97,7 @@ void testAllPredicateEx1() {
9797

9898
@Test
9999
@SuppressWarnings("unchecked")
100-
public void testAllPredicateEx2() {
100+
void testAllPredicateEx2() {
101101
assertThrows(NullPointerException.class, () -> AllPredicate.<Object>allPredicate(new Predicate[] { null }));
102102
}
103103

@@ -139,7 +139,7 @@ void testAndPredicateEx() {
139139

140140
@Test
141141
@SuppressWarnings("unchecked")
142-
public void testAnyPredicate() {
142+
void testAnyPredicate() {
143143
assertPredicateFalse(PredicateUtils.anyPredicate(), null);
144144

145145
assertTrue(PredicateUtils.anyPredicate(TruePredicate.truePredicate(), TruePredicate.truePredicate(), TruePredicate.truePredicate()).evaluate(null));
@@ -183,7 +183,7 @@ void testAnyPredicateEx1() {
183183

184184
@Test
185185
@SuppressWarnings("unchecked")
186-
public void testAnyPredicateEx2() {
186+
void testAnyPredicateEx2() {
187187
assertThrows(NullPointerException.class, () -> PredicateUtils.anyPredicate(new Predicate[] {null}));
188188
}
189189

@@ -354,7 +354,7 @@ void testNeitherPredicateEx() {
354354

355355
@Test
356356
@SuppressWarnings("unchecked")
357-
public void testNonePredicate() {
357+
void testNonePredicate() {
358358
assertPredicateTrue(PredicateUtils.nonePredicate(), null);
359359
assertFalse(PredicateUtils.nonePredicate(TruePredicate.truePredicate(), TruePredicate.truePredicate(), TruePredicate.truePredicate()).evaluate(null));
360360
assertFalse(PredicateUtils.nonePredicate(TruePredicate.truePredicate(), FalsePredicate.falsePredicate(), TruePredicate.truePredicate()).evaluate(null));
@@ -397,13 +397,13 @@ void testNonePredicateEx1() {
397397

398398
@Test
399399
@SuppressWarnings("unchecked")
400-
public void testNonePredicateEx2() {
400+
void testNonePredicateEx2() {
401401
assertThrows(NullPointerException.class, () -> PredicateUtils.nonePredicate(new Predicate[] {null}));
402402
}
403403

404404
@Test
405405
@SuppressWarnings("unchecked")
406-
public void testNonePredicateEx3() {
406+
void testNonePredicateEx3() {
407407
assertThrows(NullPointerException.class, () -> PredicateUtils.nonePredicate(null, null));
408408
}
409409

@@ -476,7 +476,7 @@ void testNullIsTruePredicateEx1() {
476476

477477
@Test
478478
@SuppressWarnings("unchecked")
479-
public void testOnePredicate() {
479+
void testOnePredicate() {
480480
assertPredicateFalse(PredicateUtils.onePredicate((Predicate<Object>[]) new Predicate[] {}), null);
481481
assertFalse(PredicateUtils.onePredicate(TruePredicate.truePredicate(), TruePredicate.truePredicate(), TruePredicate.truePredicate()).evaluate(null));
482482
assertFalse(PredicateUtils.onePredicate(TruePredicate.truePredicate(), FalsePredicate.falsePredicate(), TruePredicate.truePredicate()).evaluate(null));
@@ -521,7 +521,7 @@ void testOnePredicateEx1() {
521521

522522
@Test
523523
@SuppressWarnings("unchecked")
524-
public void testOnePredicateEx2() {
524+
void testOnePredicateEx2() {
525525
assertThrows(NullPointerException.class, () -> PredicateUtils.onePredicate(new Predicate[] {null}));
526526
}
527527

@@ -537,7 +537,7 @@ void testOnePredicateEx4() {
537537

538538
@Test
539539
@SuppressWarnings("unchecked")
540-
public void testOnePredicateEx5() {
540+
void testOnePredicateEx5() {
541541
PredicateUtils.onePredicate(Collections.EMPTY_LIST);
542542
}
543543

0 commit comments

Comments
 (0)