Skip to content

Commit

Permalink
Add failing test for #2024
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 4, 2018
1 parent d7b8e87 commit fa240dd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.core.type.TypeReference;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.fasterxml.jackson.failing;

import com.fasterxml.jackson.annotation.*;

import com.fasterxml.jackson.databind.*;

public class NullConversionWithCreatorTest extends BaseMapTest
{
static class EmptyFromNullViaCreator {
Point p;

@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
public EmptyFromNullViaCreator(@JsonSetter(nulls=Nulls.AS_EMPTY)
@JsonProperty("p") Point p)
{
this.p = p;
}
}

/*
/**********************************************************
/* Test methods
/**********************************************************
*/
private final ObjectMapper MAPPER = newObjectMapper();

public void testEmptyFromNullViaCreator() throws Exception
{
EmptyFromNullViaCreator result = MAPPER.readValue(aposToQuotes("{'p':null}"),
EmptyFromNullViaCreator.class);
assertNotNull(result);
assertNotNull(result.p);
}
}

0 comments on commit fa240dd

Please sign in to comment.