|
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.
|
@@ -607,8 +607,26 @@ void convertObjectArrayToIntArray() {
|
607 | 607 | assertThat(result).containsExactly(1, 2, 3);
|
608 | 608 | }
|
609 | 609 |
|
| 610 | + @Test // gh-33212 |
| 611 | + void convertIntArrayToObjectArray() { |
| 612 | + Object[] result = conversionService.convert(new int[] {1, 2}, Object[].class); |
| 613 | + assertThat(result).containsExactly(1, 2); |
| 614 | + } |
| 615 | + |
| 616 | + @Test |
| 617 | + void convertIntArrayToFloatArray() { |
| 618 | + Float[] result = conversionService.convert(new int[] {1, 2}, Float[].class); |
| 619 | + assertThat(result).containsExactly(1.0F, 2.0F); |
| 620 | + } |
| 621 | + |
| 622 | + @Test |
| 623 | + void convertIntArrayToPrimitiveFloatArray() { |
| 624 | + float[] result = conversionService.convert(new int[] {1, 2}, float[].class); |
| 625 | + assertThat(result).containsExactly(1.0F, 2.0F); |
| 626 | + } |
| 627 | + |
610 | 628 | @Test
|
611 |
| - void convertByteArrayToWrapperArray() { |
| 629 | + void convertPrimitiveByteArrayToByteWrapperArray() { |
612 | 630 | byte[] byteArray = {1, 2, 3};
|
613 | 631 | Byte[] converted = conversionService.convert(byteArray, Byte[].class);
|
614 | 632 | assertThat(converted).isEqualTo(new Byte[]{1, 2, 3});
|
|
0 commit comments