@@ -62,6 +62,7 @@ public void testFailOnNullFromDefaults() throws Exception
62
62
fail ("Should not pass" );
63
63
} catch (InvalidNullException e ) {
64
64
verifyException (e , "property \" values\" " );
65
+ assertEquals (String .class , e .getTargetType ());
65
66
}
66
67
67
68
// or configured for type:
@@ -73,6 +74,7 @@ public void testFailOnNullFromDefaults() throws Exception
73
74
fail ("Should not pass" );
74
75
} catch (InvalidNullException e ) {
75
76
verifyException (e , "property \" values\" " );
77
+ assertEquals (String .class , e .getTargetType ());
76
78
}
77
79
}
78
80
@@ -96,6 +98,7 @@ public void testFailOnNullWithCollections() throws Exception
96
98
fail ("Should not pass" );
97
99
} catch (InvalidNullException e ) {
98
100
verifyException (e , "property \" noNulls\" " );
101
+ assertEquals (Integer .class , e .getTargetType ());
99
102
}
100
103
101
104
// List<String>
@@ -104,6 +107,7 @@ public void testFailOnNullWithCollections() throws Exception
104
107
fail ("Should not pass" );
105
108
} catch (InvalidNullException e ) {
106
109
verifyException (e , "property \" noNulls\" " );
110
+ assertEquals (String .class , e .getTargetType ());
107
111
}
108
112
}
109
113
@@ -116,6 +120,7 @@ public void testFailOnNullWithArrays() throws Exception
116
120
fail ("Should not pass" );
117
121
} catch (InvalidNullException e ) {
118
122
verifyException (e , "property \" noNulls\" " );
123
+ assertEquals (Object .class , e .getTargetType ());
119
124
}
120
125
121
126
// String[]
@@ -124,6 +129,7 @@ public void testFailOnNullWithArrays() throws Exception
124
129
fail ("Should not pass" );
125
130
} catch (InvalidNullException e ) {
126
131
verifyException (e , "property \" noNulls\" " );
132
+ assertEquals (String .class , e .getTargetType ());
127
133
}
128
134
}
129
135
@@ -137,20 +143,23 @@ public void testFailOnNullWithPrimitiveArrays() throws Exception
137
143
fail ("Should not pass" );
138
144
} catch (InvalidNullException e ) {
139
145
verifyException (e , "property \" noNulls\" " );
146
+ assertEquals (Boolean .TYPE , e .getTargetType ());
140
147
}
141
148
// int[]
142
149
try {
143
150
MAPPER .readValue (JSON , new TypeReference <NullContentFail <int []>>() { });
144
151
fail ("Should not pass" );
145
152
} catch (InvalidNullException e ) {
146
153
verifyException (e , "property \" noNulls\" " );
154
+ assertEquals (Integer .TYPE , e .getTargetType ());
147
155
}
148
156
// double[]
149
157
try {
150
158
MAPPER .readValue (JSON , new TypeReference <NullContentFail <double []>>() { });
151
159
fail ("Should not pass" );
152
160
} catch (InvalidNullException e ) {
153
161
verifyException (e , "property \" noNulls\" " );
162
+ assertEquals (Double .TYPE , e .getTargetType ());
154
163
}
155
164
}
156
165
@@ -163,6 +172,7 @@ public void testFailOnNullWithMaps() throws Exception
163
172
fail ("Should not pass" );
164
173
} catch (InvalidNullException e ) {
165
174
verifyException (e , "property \" noNulls\" " );
175
+ assertEquals (String .class , e .getTargetType ());
166
176
}
167
177
168
178
// Then: EnumMap<Enum,String>
@@ -172,6 +182,7 @@ public void testFailOnNullWithMaps() throws Exception
172
182
fail ("Should not pass" );
173
183
} catch (InvalidNullException e ) {
174
184
verifyException (e , "property \" noNulls\" " );
185
+ assertEquals (String .class , e .getTargetType ());
175
186
}
176
187
}
177
188
0 commit comments