• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.fasterxml.jackson.databind.cfg;
2 
3 import com.fasterxml.jackson.databind.*;
4 
5 import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
6 import com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver;
7 
8 public class ConfigObjectsTest extends BaseMapTest
9 {
10     static class Base { }
11     static class Sub extends Base { }
12 
testSubtypeResolver()13     public void testSubtypeResolver() throws Exception
14     {
15         ObjectMapper mapper = new ObjectMapper();
16         SubtypeResolver res = mapper.getSubtypeResolver();
17         assertTrue(res instanceof StdSubtypeResolver);
18 
19         StdSubtypeResolver repl = new StdSubtypeResolver();
20         repl.registerSubtypes(Sub.class);
21         mapper.setSubtypeResolver(repl);
22         assertSame(repl, mapper.getSubtypeResolver());
23     }
24 
testMics()25     public void testMics() throws Exception
26     {
27         assertFalse(MapperFeature.AUTO_DETECT_FIELDS.enabledIn(0));
28         assertTrue(MapperFeature.AUTO_DETECT_FIELDS.enabledIn(-1));
29     }
30 }
31