Skip to content

Commit

Permalink
Add a failing test for #349
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Nov 30, 2016
1 parent f609683 commit 152f855
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/test/java/com/fasterxml/jackson/failing/AnySetter349Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.fasterxml.jackson.failing;

import java.util.*;

import com.fasterxml.jackson.annotation.*;

import com.fasterxml.jackson.databind.*;

// test(s) for [databind#349]
public class AnySetter349Test extends BaseMapTest
{
static class Bean349
{
public String type;

private Map<String, Object> props = new HashMap<>();

@JsonAnySetter
public void addProperty(String key, Object value) {
props.put(key, value);
}

@JsonAnyGetter
public Map<String, Object> getProperties() {
return props;
}

@JsonUnwrapped
public IdentityDTO349 identity = null;
}

static class IdentityDTO349 {
public int x, y;
}

public void testUnwrappedWithAny() throws Exception
{
final ObjectMapper mapper = objectMapper();
final String json = aposToQuotes(
"{ 'type' : 'IST',\n"
+" 'spacename' : 'Foo Models',\n"
+" 'name' : 'BLAH-New',\n"
+" 'description' : 'namespace.name: X THIN FIR.DR-WD12-New',\n"
+" 'ZoomLinks': [ 'foofoofoofoo', 'barbarbarbar' ] }"
);
Bean349 value = mapper.readValue(json, Bean349.class);
assertNotNull(value);
}
}

0 comments on commit 152f855

Please sign in to comment.