Search in sources :

Example 1 with WithArrayOfByteArray

use of org.mapstruct.ap.test.bugs._895.MultiArrayMapper.WithArrayOfByteArray in project mapstruct by mapstruct.

the class Issue895Test method properlyMapsMultiDimensionalArrays.

@ProcessorTest
public void properlyMapsMultiDimensionalArrays() {
    WithArrayOfByteArray arrayOfByteArray = new WithArrayOfByteArray();
    arrayOfByteArray.setBytes(new byte[][] { new byte[] { 0, 1 }, new byte[] { 1, 2 } });
    WithListOfByteArray listOfByteArray = Mappers.getMapper(MultiArrayMapper.class).convert(arrayOfByteArray);
    assertThat(listOfByteArray.getBytes()).containsExactly(new byte[] { 0, 1 }, new byte[] { 1, 2 });
    arrayOfByteArray = Mappers.getMapper(MultiArrayMapper.class).convert(listOfByteArray);
    assertThat(arrayOfByteArray.getBytes()).isDeepEqualTo(new byte[][] { { 0, 1 }, { 1, 2 } });
}
Also used : WithListOfByteArray(org.mapstruct.ap.test.bugs._895.MultiArrayMapper.WithListOfByteArray) WithArrayOfByteArray(org.mapstruct.ap.test.bugs._895.MultiArrayMapper.WithArrayOfByteArray) ProcessorTest(org.mapstruct.ap.testutil.ProcessorTest)

Aggregations

WithArrayOfByteArray (org.mapstruct.ap.test.bugs._895.MultiArrayMapper.WithArrayOfByteArray)1 WithListOfByteArray (org.mapstruct.ap.test.bugs._895.MultiArrayMapper.WithListOfByteArray)1 ProcessorTest (org.mapstruct.ap.testutil.ProcessorTest)1