1 package com.fasterxml.jackson.databind.introspect;
2 
3 import com.fasterxml.jackson.databind.*;
4 
5 // mostly for [databind#1033]
6 public class SetterConflictTest extends BaseMapTest
7 {
8     // Should prefer primitives over Strings, more complex types, by default
9     static class Issue1033Bean {
10         public int value;
11 
setValue(int v)12         public void setValue(int v) { value = v; }
setValue(Issue1033Bean foo)13         public void setValue(Issue1033Bean foo) {
14             throw new Error("Should not get called");
15         }
16     }
17 
18     /*
19     /**********************************************************
20     /* Test methods
21     /**********************************************************
22      */
23 
24     private final ObjectMapper MAPPER = objectMapper();
25 
testSetterPriority()26     public void testSetterPriority() throws Exception
27     {
28         Issue1033Bean bean = MAPPER.readValue(aposToQuotes("{'value':42}"),
29                 Issue1033Bean.class);
30         assertEquals(42, bean.value);
31     }
32 }
33