@@ -169,7 +169,21 @@ public void setupModule(SetupContext context)
169
169
assertNotNull (m );
170
170
}
171
171
}
172
-
172
+
173
+ static class TestModule626 extends SimpleModule {
174
+ final Class <?> mixin , target ;
175
+ public TestModule626 (Class <?> t , Class <?> m ) {
176
+ super ("Test" );
177
+ target = t ;
178
+ mixin = m ;
179
+ }
180
+
181
+ @ Override
182
+ public void setupModule (SetupContext context ) {
183
+ context .setMixInAnnotations (target , mixin );
184
+ }
185
+ }
186
+
173
187
/*
174
188
/**********************************************************
175
189
/* Unit tests; first, verifying need for custom handlers
@@ -199,13 +213,13 @@ public void testWithoutModule()
199
213
verifyException (e , "No suitable constructor found" );
200
214
}
201
215
}
202
-
216
+
203
217
/*
204
218
/**********************************************************
205
219
/* Unit tests; simple serializers
206
220
/**********************************************************
207
221
*/
208
-
222
+
209
223
public void testSimpleBeanSerializer () throws Exception
210
224
{
211
225
ObjectMapper mapper = new ObjectMapper ();
@@ -315,5 +329,14 @@ public void testAccessToMapper() throws Exception
315
329
ObjectMapper mapper = new ObjectMapper ();
316
330
mapper .registerModule (module );
317
331
}
318
- }
319
332
333
+ // [databind#626]
334
+ public void testMixIns626 () throws Exception
335
+ {
336
+ ObjectMapper mapper = new ObjectMapper ();
337
+ // no real annotations, but nominally add ones from 'String' to 'Object', just for testing
338
+ mapper .registerModule (new TestModule626 (Object .class , String .class ));
339
+ Class <?> found = mapper .findMixInClassFor (Object .class );
340
+ assertEquals (String .class , found );
341
+ }
342
+ }
0 commit comments