@@ -69,6 +69,35 @@ public void shouldConvertArrayToCollection() {
69
69
assertThat (result .ids ).contains ("foo" , "bar" );
70
70
}
71
71
72
+ @ Test // gh-30
73
+ public void shouldConvertArrayToSet () {
74
+
75
+ EntityRowMapper <EntityWithCollection > mapper = getRowMapper (EntityWithCollection .class );
76
+ when (rowMock .get ("integerSet" )).thenReturn ((new int [] { 3 , 14 }));
77
+
78
+ EntityWithCollection result = mapper .apply (rowMock , metadata );
79
+ assertThat (result .integerSet ).contains (3 , 14 );
80
+ }
81
+
82
+ @ Test // gh-30
83
+ public void shouldConvertArrayMembers () {
84
+
85
+ EntityRowMapper <EntityWithCollection > mapper = getRowMapper (EntityWithCollection .class );
86
+ when (rowMock .get ("primitiveIntegers" )).thenReturn ((new long [] { 3L , 14L }));
87
+
88
+ EntityWithCollection result = mapper .apply (rowMock , metadata );
89
+ assertThat (result .primitiveIntegers ).contains (3 , 14 );
90
+ }
91
+
92
+ @ Test // gh-30
93
+ public void shouldConvertArrayToBoxedArray () {
94
+
95
+ EntityRowMapper <EntityWithCollection > mapper = getRowMapper (EntityWithCollection .class );
96
+ when (rowMock .get ("boxedIntegers" )).thenReturn ((new int [] { 3 , 11 }));
97
+
98
+ EntityWithCollection result = mapper .apply (rowMock , metadata );
99
+ assertThat (result .boxedIntegers ).contains (3 , 11 );
100
+ }
72
101
@ SuppressWarnings ("unchecked" )
73
102
private <T > EntityRowMapper <T > getRowMapper (Class <T > type ) {
74
103
RelationalPersistentEntity <T > entity = (RelationalPersistentEntity <T >) strategy .getMappingContext ()
0 commit comments