Skip to content

Commit

Permalink
Added #323 unit test: appears to pass with 2.4.0-SNAPSHOT (master).
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 17, 2014
1 parent 301ea2d commit 0a4251a
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ int x()
}
}

// [Issue#323]
static class Bean323 {
private int a;

public Bean323 (@JsonProperty("a") final int a ) {
this.a = a;
}

@JsonProperty("b")
private int getA () {
return a;
}
}

/* We should only report an exception for cases where there is
* real ambiguity as to how to rename things; but not when everything
* has been explicitly defined
Expand All @@ -42,19 +56,27 @@ public int getA() {
return 1;
}
}

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

// [Issue#193]
public void testIssue193() throws Exception
{
String json = objectWriter().writeValueAsString(new Bean193(1, 2));
assertNotNull(json);
}

// [Issue#323]
public void testCreatorPropRename() throws Exception
{
Bean323 input = new Bean323(7);
assertEquals("{\"b\":7}", objectWriter().writeValueAsString(input));
}

// [Issue#327]
public void testNonConflict() throws Exception
{
Expand Down

0 comments on commit 0a4251a

Please sign in to comment.