|
20 | 20 | import static org.junit.jupiter.api.Assertions.assertEquals; |
21 | 21 | import static org.junit.jupiter.api.Assertions.assertFalse; |
22 | 22 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
| 23 | +import static org.junit.jupiter.api.Assertions.assertNull; |
23 | 24 | import static org.junit.jupiter.api.Assertions.assertThrows; |
24 | 25 | import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively; |
25 | 26 | import static org.junit.jupiter.api.Assertions.assertTrue; |
@@ -213,6 +214,19 @@ void wideningConversion() { |
213 | 214 | assertFalse(isWideningConversion(String.class, int.class)); // neither a primitive nor a wrapper |
214 | 215 | } |
215 | 216 |
|
| 217 | + @Test |
| 218 | + void getWrapperType() { |
| 219 | + assertEquals(Boolean.class, ReflectionUtils.getWrapperType(boolean.class)); |
| 220 | + assertEquals(Byte.class, ReflectionUtils.getWrapperType(byte.class)); |
| 221 | + assertEquals(Character.class, ReflectionUtils.getWrapperType(char.class)); |
| 222 | + assertEquals(Short.class, ReflectionUtils.getWrapperType(short.class)); |
| 223 | + assertEquals(Integer.class, ReflectionUtils.getWrapperType(int.class)); |
| 224 | + assertEquals(Long.class, ReflectionUtils.getWrapperType(long.class)); |
| 225 | + assertEquals(Float.class, ReflectionUtils.getWrapperType(float.class)); |
| 226 | + assertEquals(Double.class, ReflectionUtils.getWrapperType(double.class)); |
| 227 | + assertNull(ReflectionUtils.getWrapperType(Object.class)); |
| 228 | + } |
| 229 | + |
216 | 230 | @Test |
217 | 231 | void getAllClasspathRootDirectories(@TempDir Path tempDirectory) throws Exception { |
218 | 232 | var root1 = tempDirectory.resolve("root1").toAbsolutePath(); |
|
0 commit comments