Skip to content

Commit

Permalink
Add unit test for #656
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 17, 2014
1 parent 5b9f87c commit 966dd97
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ public static class GoodSub2 extends GoodItem {

}

// for [databind#656]
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.WRAPPER_OBJECT, defaultImpl=ImplFor656.class)
static abstract class BaseFor656 { }

static class ImplFor656 extends BaseFor656 {
public int a;
}

/*
/**********************************************************
/* Unit tests, deserialization
Expand Down Expand Up @@ -177,6 +185,15 @@ public void testInvalidTypeId511() throws Exception {
assertNotNull(badResult);
}

// [Databind#656]
public void testDefaultImplWithObjectWrapper() throws Exception
{
BaseFor656 value = MAPPER.readValue(aposToQuotes("{'foobar':{'a':3}}"), BaseFor656.class);
assertNotNull(value);
assertEquals(ImplFor656.class, value.getClass());
assertEquals(3, ((ImplFor656) value).a);
}

/*
/**********************************************************
/* Unit tests, serialization
Expand Down

0 comments on commit 966dd97

Please sign in to comment.