Expand test coverage for gh-14200
This commit is contained in:
@@ -666,9 +666,19 @@ class DefaultConversionServiceTests {
|
|||||||
assertThat(converted).isEqualTo(new Byte[]{1, 2, 3});
|
assertThat(converted).isEqualTo(new Byte[]{1, 2, 3});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test // gh-14200, SPR-9566
|
||||||
|
void convertPrimitiveByteArrayToPrimitiveByteArray() {
|
||||||
|
byte[] byteArray = new byte[] {1, 2, 3};
|
||||||
|
byte[] result = conversionService.convert(byteArray, byte[].class);
|
||||||
|
assertThat(result).isSameAs(byteArray);
|
||||||
|
assertThat(result).containsExactly(1, 2, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test // gh-14200, SPR-9566
|
||||||
void convertIntArrayToIntArray() {
|
void convertIntArrayToIntArray() {
|
||||||
int[] result = conversionService.convert(new int[] {1, 2, 3}, int[].class);
|
int[] intArray = new int[] {1, 2, 3};
|
||||||
|
int[] result = conversionService.convert(intArray, int[].class);
|
||||||
|
assertThat(result).isSameAs(intArray);
|
||||||
assertThat(result).containsExactly(1, 2, 3);
|
assertThat(result).containsExactly(1, 2, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -461,12 +461,12 @@ class GenericConversionServiceTests {
|
|||||||
assertThat(converter.getSourceTypes().stream().allMatch(td -> Integer.class.equals(td.getType()))).isTrue();
|
assertThat(converter.getSourceTypes().stream().allMatch(td -> Integer.class.equals(td.getType()))).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test // gh-14200, SPR-9566
|
||||||
void convertOptimizeArray() {
|
void convertOptimizeArray() {
|
||||||
// SPR-9566
|
|
||||||
byte[] byteArray = new byte[] { 1, 2, 3 };
|
byte[] byteArray = new byte[] { 1, 2, 3 };
|
||||||
byte[] converted = conversionService.convert(byteArray, byte[].class);
|
byte[] converted = conversionService.convert(byteArray, byte[].class);
|
||||||
assertThat(converted).isSameAs(byteArray);
|
assertThat(converted).isSameAs(byteArray);
|
||||||
|
assertThat(converted).containsExactly(1, 2, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user