|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -626,9 +626,27 @@ void convertObjectArrayToIntArray() {
|
626 | 626 | assertThat(result[2]).isEqualTo(3);
|
627 | 627 | }
|
628 | 628 |
|
| 629 | + @Test // gh-33212 |
| 630 | + void convertIntArrayToObjectArray() { |
| 631 | + Object[] result = conversionService.convert(new int[] {1, 2}, Object[].class); |
| 632 | + assertThat(result).containsExactly(1, 2); |
| 633 | + } |
| 634 | + |
629 | 635 | @Test
|
630 |
| - void convertByteArrayToWrapperArray() { |
631 |
| - byte[] byteArray = new byte[] {1, 2, 3}; |
| 636 | + void convertIntArrayToFloatArray() { |
| 637 | + Float[] result = conversionService.convert(new int[] {1, 2}, Float[].class); |
| 638 | + assertThat(result).containsExactly(1.0F, 2.0F); |
| 639 | + } |
| 640 | + |
| 641 | + @Test |
| 642 | + void convertIntArrayToPrimitiveFloatArray() { |
| 643 | + float[] result = conversionService.convert(new int[] {1, 2}, float[].class); |
| 644 | + assertThat(result).containsExactly(1.0F, 2.0F); |
| 645 | + } |
| 646 | + |
| 647 | + @Test |
| 648 | + void convertPrimitiveByteArrayToByteWrapperArray() { |
| 649 | + byte[] byteArray = {1, 2, 3}; |
632 | 650 | Byte[] converted = conversionService.convert(byteArray, Byte[].class);
|
633 | 651 | assertThat(converted).isEqualTo(new Byte[]{1, 2, 3});
|
634 | 652 | }
|
|
0 commit comments