Skip to content

Commit 129ea41

Browse files
committed
Replace JUnit @DisplayName with Javadoc to make Maven output meaningful
1 parent 0a8ac74 commit 129ea41

File tree

5 files changed

+21
-26
lines changed

5 files changed

+21
-26
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import org.apache.commons.lang3.reflect.testbed.GenericParent;
4949
import org.apache.commons.lang3.reflect.testbed.StringParameterizedChild;
5050
import org.junit.jupiter.api.Assertions;
51-
import org.junit.jupiter.api.DisplayName;
5251
import org.junit.jupiter.api.Test;
5352
import org.junit.jupiter.params.ParameterizedTest;
5453
import org.junitpioneer.jupiter.params.IntRangeSource;
@@ -191,13 +190,13 @@ void test_getAbbreviatedName_Class() {
191190
}
192191

193192
@Test
194-
@DisplayName("When the desired length is negative then exception is thrown")
193+
/** When the desired length is negative then exception is thrown */
195194
void test_getAbbreviatedName_Class_NegativeLen() {
196195
assertIllegalArgumentException(() -> ClassUtils.getAbbreviatedName(String.class, -10));
197196
}
198197

199198
@Test
200-
@DisplayName("When the desired length is zero then exception is thrown")
199+
/** When the desired length is zero then exception is thrown */
201200
void test_getAbbreviatedName_Class_ZeroLen() {
202201
assertIllegalArgumentException(() -> ClassUtils.getAbbreviatedName(String.class, 0));
203202
}
@@ -231,7 +230,7 @@ void test_getAbbreviatedName_String() {
231230
* implementation detail, but it is not a guaranteed feature of the implementation.
232231
*/
233232
@Test
234-
@DisplayName("When the length hint is longer than the actual length then the same String object is returned")
233+
/** When the length hint is longer than the actual length then the same String object is returned */
235234
void test_getAbbreviatedName_TooLongHint() {
236235
final String className = "java.lang.String";
237236
Assertions.assertSame(className, ClassUtils.getAbbreviatedName(className, className.length() + 1));

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.apache.commons.lang3.Functions.FailableConsumer;
4343
import org.apache.commons.lang3.Functions.FailableFunction;
4444
import org.apache.commons.lang3.Functions.FailableSupplier;
45-
import org.junit.jupiter.api.DisplayName;
4645
import org.junit.jupiter.api.Test;
4746

4847
/**
@@ -666,7 +665,7 @@ void testBiFunction() {
666665
}
667666

668667
@Test
669-
@DisplayName("Test that asPredicate(FailableBiPredicate) is converted to -> BiPredicate ")
668+
/** Test that asPredicate(FailableBiPredicate) is converted to -> BiPredicate */
670669
void testBiPredicate() {
671670
FailureOnOddInvocations.invocations = 0;
672671
final Functions.FailableBiPredicate<Object, Object, Throwable> failableBiPredicate = (t1,
@@ -768,7 +767,7 @@ void testGetSupplier() {
768767
}
769768

770769
@Test
771-
@DisplayName("Test that asPredicate(FailablePredicate) is converted to -> Predicate ")
770+
/** Test that asPredicate(FailablePredicate) is converted to -> Predicate */
772771
void testPredicate() {
773772
FailureOnOddInvocations.invocations = 0;
774773
final Functions.FailablePredicate<Object, Throwable> failablePredicate = t -> FailureOnOddInvocations

src/test/java/org/apache/commons/lang3/compare/ComparableUtilsTest.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.time.Instant;
2626

2727
import org.apache.commons.lang3.AbstractLangTest;
28-
import org.junit.jupiter.api.DisplayName;
2928
import org.junit.jupiter.api.Nested;
3029
import org.junit.jupiter.api.Test;
3130

@@ -34,11 +33,11 @@ class ComparableUtilsTest extends AbstractLangTest {
3433
@Nested
3534
final class A_is_1 {
3635

37-
@DisplayName("B is 0 (B < A)")
36+
/** B is 0 (B < A) */
3837
@Nested
3938
final class B_is_0 {
4039

41-
@DisplayName("C is 0 ([B=C] < A)")
40+
/** C is 0 ([B=C] < A) */
4241
@Nested
4342
final class C_is_0 {
4443

@@ -66,7 +65,7 @@ void static_betweenExclusive_returns_false() {
6665

6766
}
6867

69-
@DisplayName("C is 1 (B < A = C)")
68+
/** C is 1 (B < A = C) */
7069
@Nested
7170
final class C_is_1 {
7271

@@ -93,7 +92,7 @@ void static_betweenExclusive_returns_false() {
9392
}
9493
}
9594

96-
@DisplayName("C is 10 (B < A < C)")
95+
/** C is 10 (B < A < C) */
9796
@Nested
9897
final class C_is_10 {
9998

@@ -168,11 +167,11 @@ void static_lt_returns_false() {
168167
}
169168
}
170169

171-
@DisplayName("B is 1 (B = A)")
170+
/** B is 1 (B = A) */
172171
@Nested
173172
final class B_is_1 {
174173

175-
@DisplayName("C is 0 (B = A > C)")
174+
/** C is 0 (B = A > C) */
176175
@Nested
177176
final class C_is_0 {
178177

@@ -199,7 +198,7 @@ void static_betweenExclusive_returns_false() {
199198
}
200199
}
201200

202-
@DisplayName("C is 1 (B = A = C)")
201+
/** C is 1 (B = A = C) */
203202
@Nested
204203
final class C_is_1 {
205204

@@ -226,7 +225,7 @@ void static_betweenExclusive_returns_false() {
226225
}
227226
}
228227

229-
@DisplayName("C is 10 (B = A < C)")
228+
/** C is 10 (B = A < C) */
230229
@Nested
231230
final class C_is_10 {
232231

@@ -301,11 +300,11 @@ void static_lt_returns_false() {
301300
}
302301
}
303302

304-
@DisplayName("B is 10 (B > A)")
303+
/** B is 10 (B > A) */
305304
@Nested
306305
final class B_is_10 {
307306

308-
@DisplayName("C is 0 (B > A > C)")
307+
/** C is 0 (B > A > C) */
309308
@Nested
310309
final class C_is_0 {
311310

@@ -332,7 +331,7 @@ void static_betweenExclusive_returns_true() {
332331
}
333332
}
334333

335-
@DisplayName("C is 1 (B > A = C)")
334+
/** C is 1 (B > A = C) */
336335
@Nested
337336
final class C_is_1 {
338337

@@ -359,7 +358,7 @@ void static_betweenExclusive_returns_false() {
359358
}
360359
}
361360

362-
@DisplayName("C is 10 ([B,C] > A)")
361+
/** C is 10 ([B,C] > A) */
363362
@Nested
364363
final class C_is_10 {
365364

src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.apache.commons.lang3.test.NotVisibleExceptionFactory;
4343
import org.junit.jupiter.api.AfterEach;
4444
import org.junit.jupiter.api.BeforeEach;
45-
import org.junit.jupiter.api.DisplayName;
4645
import org.junit.jupiter.api.Test;
4746

4847
/**
@@ -393,7 +392,7 @@ void testGetRootCauseStackTraceList_Throwable() {
393392
}
394393

395394
@Test
396-
@DisplayName("getStackFrames returns empty string array when the argument is null")
395+
/** getStackFrames returns empty string array when the argument is null */
397396
void testgetStackFramesHappyPath() {
398397
final String[] actual = ExceptionUtils.getStackFrames(new Throwable() {
399398
private static final long serialVersionUID = 1L;
@@ -419,7 +418,7 @@ public void printStackTrace(final PrintWriter s) {
419418
}
420419

421420
@Test
422-
@DisplayName("getStackFrames returns the string array of the stack frames when there is a real exception")
421+
/** getStackFrames returns the string array of the stack frames when there is a real exception */
423422
void testgetStackFramesNullArg() {
424423
final String[] actual = ExceptionUtils.getStackFrames((Throwable) null);
425424
assertEquals(0, actual.length);

src/test/java/org/apache/commons/lang3/function/FailableTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.apache.commons.lang3.AbstractLangTest;
4242
import org.apache.commons.lang3.StringUtils;
4343
import org.junit.jupiter.api.BeforeEach;
44-
import org.junit.jupiter.api.DisplayName;
4544
import org.junit.jupiter.api.Test;
4645

4746
/**
@@ -853,7 +852,7 @@ void testBiFunctionAndThen() throws IOException {
853852
}
854853

855854
@Test
856-
@DisplayName("Test that asPredicate(FailableBiPredicate) is converted to -> BiPredicate ")
855+
/** Test that asPredicate(FailableBiPredicate) is converted to -> BiPredicate */
857856
void testBiPredicate() {
858857
FailureOnOddInvocations.invocations = 0;
859858
final FailableBiPredicate<Object, Object, Throwable> failableBiPredicate = (t1, t2) -> FailureOnOddInvocations
@@ -1607,7 +1606,7 @@ void testLongUnaryOperatorIdentity() throws Throwable {
16071606
}
16081607

16091608
@Test
1610-
@DisplayName("Test that asPredicate(FailablePredicate) is converted to -> Predicate ")
1609+
/** Test that asPredicate(FailablePredicate) is converted to -> Predicate */
16111610
void testPredicate() {
16121611
FailureOnOddInvocations.invocations = 0;
16131612
final FailablePredicate<Object, Throwable> failablePredicate = t -> FailureOnOddInvocations.testGetBool();

0 commit comments

Comments
 (0)