1
1
package org .springframework .data .r2dbc .dialect ;
2
2
3
3
import static org .assertj .core .api .Assertions .*;
4
+ import static org .assertj .core .api .SoftAssertions .*;
5
+
6
+ import java .util .List ;
4
7
5
- import org .assertj .core .api .SoftAssertions ;
6
8
import org .junit .Test ;
7
9
import org .springframework .data .mapping .model .SimpleTypeHolder ;
8
10
@@ -30,7 +32,7 @@ public void shouldConsiderSimpleTypes() {
30
32
31
33
SimpleTypeHolder holder = PostgresDialect .INSTANCE .getSimpleTypeHolder ();
32
34
33
- SoftAssertions . assertSoftly (it -> {
35
+ assertSoftly (it -> {
34
36
it .assertThat (holder .isSimpleType (String .class )).isTrue ();
35
37
it .assertThat (holder .isSimpleType (int .class )).isTrue ();
36
38
it .assertThat (holder .isSimpleType (Integer .class )).isTrue ();
@@ -50,9 +52,11 @@ public void shouldUseBoxedArrayTypesForPrimitiveTypes() {
50
52
51
53
ArrayColumns arrayColumns = PostgresDialect .INSTANCE .getArraySupport ();
52
54
53
- assertThat (arrayColumns .getArrayType (int .class )).isEqualTo (Integer .class );
54
- assertThat (arrayColumns .getArrayType (double .class )).isEqualTo (Double .class );
55
- assertThat (arrayColumns .getArrayType (String .class )).isEqualTo (String .class );
55
+ assertSoftly (it -> {
56
+ it .assertThat (arrayColumns .getArrayType (int .class )).isEqualTo (Integer .class );
57
+ it .assertThat (arrayColumns .getArrayType (double .class )).isEqualTo (Double .class );
58
+ it .assertThat (arrayColumns .getArrayType (String .class )).isEqualTo (String .class );
59
+ });
56
60
}
57
61
58
62
@ Test // gh-30
@@ -62,4 +66,12 @@ public void shouldRejectNonSimpleArrayTypes() {
62
66
63
67
assertThatThrownBy (() -> arrayColumns .getArrayType (getClass ())).isInstanceOf (IllegalArgumentException .class );
64
68
}
69
+
70
+ @ Test // gh-30
71
+ public void shouldRejectNestedCollections () {
72
+
73
+ ArrayColumns arrayColumns = PostgresDialect .INSTANCE .getArraySupport ();
74
+
75
+ assertThatThrownBy (() -> arrayColumns .getArrayType (List .class )).isInstanceOf (IllegalArgumentException .class );
76
+ }
65
77
}
0 commit comments