Skip to content

Commit

Permalink
Merge branch '2.10' into 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 6, 2019
2 parents 3090479 + f229cb0 commit fe5ed28
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 68 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.fasterxml.jackson.databind.misc;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;

import com.fasterxml.jackson.core.JsonProcessingException;

import com.fasterxml.jackson.databind.*;

public class CaseInsensitiveDeserTest extends BaseMapTest
Expand Down Expand Up @@ -44,6 +48,51 @@ public InsensitiveCreator(@JsonProperty("value") int v0) {
}
}

// [databind#1854]
static class Obj1854 {
private final int id;

private final List<ChildObj1854> items;

public Obj1854(int id, List<ChildObj1854> items) {
this.id = id;
this.items = items;
}

@JsonCreator
public static Obj1854 fromJson(@JsonProperty("ID") int id,
@JsonProperty("Items") List<ChildObj1854> items) {
return new Obj1854(id, items);
}

public int getId() {
return id;
}

public List<ChildObj1854> getItems() {
return items;
}

}

// [databind#1854]
static class ChildObj1854 {
private final String childId;

private ChildObj1854(String id) {
this.childId = id;
}

@JsonCreator
public static ChildObj1854 fromJson(@JsonProperty("ChildID") String cid) {
return new ChildObj1854(cid);
}

public String getId() {
return childId;
}
}

/*
/********************************************************
/* Test methods
Expand Down Expand Up @@ -122,4 +171,14 @@ public void testCaseInsensitiveWithClassFormat() throws Exception
assertEquals("12", role.ID);
assertEquals("Foo", role.Name);
}

public void testIssue1854() throws Exception
{
final String DOC = aposToQuotes("{'ID': 1, 'Items': [ { 'ChildID': 10 } ]}");
Obj1854 result = INSENSITIVE_MAPPER.readValue(DOC, Obj1854.class);
assertNotNull(result);
assertEquals(1, result.getId());
assertNotNull(result.getItems());
assertEquals(1, result.getItems().size());
}
}

0 comments on commit fe5ed28

Please sign in to comment.