コード例 #1
0
 public void testSimpleIgnoreAndRename() {
   POJOPropertiesCollector coll = collector(mapper, IgnoredRenamedSetter.class, true);
   Map<String, POJOPropertyBuilder> props = coll.getPropertyMap();
   assertEquals(1, props.size());
   POJOPropertyBuilder prop = props.get("y");
   assertNotNull(prop);
   assertTrue(prop.hasSetter());
   assertFalse(prop.hasGetter());
   assertFalse(prop.hasField());
 }
コード例 #2
0
 public void testSimpleGetterVisibility() {
   POJOPropertiesCollector coll = collector(mapper, SimpleGetterVisibility.class, true);
   Map<String, POJOPropertyBuilder> props = coll.getPropertyMap();
   assertEquals(1, props.size());
   POJOPropertyBuilder prop = props.get("a");
   assertNotNull(prop);
   assertFalse(prop.hasSetter());
   assertTrue(prop.hasGetter());
   assertFalse(prop.hasField());
 }
コード例 #3
0
 public void testMergeWithRename() {
   POJOPropertiesCollector coll = collector(mapper, MergedProperties.class, true);
   Map<String, POJOPropertyBuilder> props = coll.getPropertyMap();
   assertEquals(1, props.size());
   POJOPropertyBuilder prop = props.get("x");
   assertNotNull(prop);
   assertTrue(prop.hasSetter());
   assertFalse(prop.hasGetter());
   assertTrue(prop.hasField());
 }
コード例 #4
0
 public void testSimpleFieldVisibility() {
   // false -> deserialization
   POJOPropertiesCollector coll = collector(mapper, SimpleFieldDeser.class, false);
   Map<String, POJOPropertyBuilder> props = coll.getPropertyMap();
   assertEquals(1, props.size());
   POJOPropertyBuilder prop = props.get("values");
   assertNotNull(prop);
   assertFalse(prop.hasSetter());
   assertFalse(prop.hasGetter());
   assertTrue(prop.hasField());
 }