Skip to content

Commit

Permalink
Add repro for #1572
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 29, 2017
1 parent 3dd61ce commit a2e3460
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
Expand Up @@ -36,6 +36,7 @@ public InsensitiveCreator(@JsonProperty("value") int v0) {
/* Test methods
/********************************************************
*/

private final ObjectMapper INSENSITIVE_MAPPER = new ObjectMapper();
{
INSENSITIVE_MAPPER.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES);
Expand Down
@@ -0,0 +1,48 @@
package com.fasterxml.jackson.failing;

import com.fasterxml.jackson.annotation.*;

import com.fasterxml.jackson.databind.BaseMapTest;
import com.fasterxml.jackson.databind.ObjectMapper;

public class IgnoredCreatorProperty1572Test extends BaseMapTest
{
static class InnerTest
{
public String str;
public String otherStr;
}

static class OuterTest
{
InnerTest inner;

@JsonIgnore
public String otherStr;

@JsonCreator
public OuterTest(@JsonProperty("inner") InnerTest inner,
@JsonProperty("otherOtherStr") String otherStr) {
this.inner = inner;
}
}

/*
/********************************************************
/* Test methods
/********************************************************
*/

private final ObjectMapper MAPPER = new ObjectMapper();

// [databind#1572]
public void testIgnoredCtorParam() throws Exception
{
String JSON = aposToQuotes("{'innerTest': {\n"
+"'str':'str',\n"
+"'otherStr': 'otherStr'\n"
+"}}\n");
OuterTest result = MAPPER.readValue(JSON, OuterTest.class);
assertNotNull(result);
}
}
Expand Up @@ -50,7 +50,7 @@ static class Container {
/**********************************************************
*/

// [Issue#291]
// [databind#291]
public void testMultiple() throws Exception
{
final ObjectMapper mapper = objectMapper();
Expand Down

0 comments on commit a2e3460

Please sign in to comment.