Skip to content

Commit 4859730

Browse files
committed
Add missing test coverage for
org.apache.commons.lang3.reflect.TypeUtils.toString(Type)
1 parent d6984c4 commit 4859730

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,14 @@ void testToLongString() {
10431043
assertEquals(getClass().getName() + ".MyInnerClass.MyInnerClass2:X", TypeUtils.toLongString(MyInnerClass.MyInnerClass2.class.getTypeParameters()[0]));
10441044
}
10451045

1046+
@Test
1047+
void testToString() {
1048+
assertThrows(NullPointerException.class, () -> TypeUtils.toString(null));
1049+
assertThrows(IllegalArgumentException.class, () -> TypeUtils.toString(new Type() {
1050+
// empty
1051+
}));
1052+
}
1053+
10461054
@Test
10471055
void testToString_LANG_1311() {
10481056
assertEquals("int[]", TypeUtils.toString(int[].class));

0 commit comments

Comments
 (0)