title: How to force `.andExpect(jsonPath()` to return Long/long instead int for int number for jackson parser
body: <p>I have a simple test to my RestController. I expect that <code>$[1].parent_id</code>returns Long as an object and not integer primitive. It will return Long if <code>parent_id</code> is in a long number range and > integer number range (such as : 2147483650L).</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @SpringApplicationConfiguration(classes = Application.class)
  @WebAppConfiguration
  @WebAppConfiguration
  public class TransactionServiceControllerTest {
  
  @Before
  public void setup() throws Exception {
      this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
      // I copy this from my RestController class
      this.transactions = Arrays.asList(
              new Transaction(100d, "car", null),
              new Transaction(100d, "table", 12L)
       );
  }
  
  @Test
  public void readSingleBookmark() throws Exception {
     mockMvc.perform(MockMvcRequestBuilders.get("/transaction/"))
     .andExpect(content().contentType(contentType)) // ok
     .andExpect(jsonPath("$", hasSize(2))) // ok
     //omitted
     andExpect(jsonPath("$[1].parent_id",is(this.transactions.get(1).getParentId())));
  } //assertion fail
  
  Expected: is &lt;12L&gt;
  but: was &lt;12&gt;
  </code></pre>
  
  <p>Result from another test :</p>
  
  <pre><code>Expected: is &lt;12L&gt;
  but: was &lt;2147483650L&gt; //return Long instead int
  </code></pre>
  
  <p>this is my JacksonConfiguration</p>
  
  <pre><code>@Configuration
  public class JacksonConfiguration {
  
      @Bean
      @Primary
      public ObjectMapper objectMapper() {
          final ObjectMapper objectMapper = new ObjectMapper();
  
          //supposed to be this is the magic trick but it seems not..
          objectMapper.enable(DeserializationFeature.USE_LONG_FOR_INTS);
  
  
          objectMapper.setSerializationInclusion(JsonInclude.Include.NON_ABSENT);
          objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
          return objectMapper;
      }
  }
  </code></pre>
  
  <p>And my POJO</p>
  
  <pre><code>public class Transaction {
  
  private double ammount;
  
  private String type;
  
  private Long parentId;
  
  public Transaction(Double ammount, String type, Long parentId) {
    //omitted
  }
  //setter and getter omitted
  }
  </code></pre>
  
  <p>MyRestController</p>
  
  <pre><code>@RestController
  @RequestMapping("transaction")
  public class TransactionServiceController {
  
  @RequestMapping(method = RequestMethod.GET)
  List&lt;Transaction&gt; getTransaction() {
      return
              Arrays.asList(
                      new Transaction(100d, "car", null),
                      new Transaction(100d, "table", 12L)
              );
      }
  }
  </code></pre>
  
  <p>And Application.java</p>
  
  <pre><code>@SpringBootApplication
  public class Application {
      public static void main(String[] args){
          SpringApplication.run(Application.class,args);
      }
  }
  </code></pre>