Skip to content

Commit

Permalink
add testcase for issue #569
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Feb 5, 2018
1 parent 86aa0a6 commit 00bbb28
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/test/java/com/alibaba/json/bvt/bug/Issue569_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.alibaba.json.bvt.bug;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import junit.framework.TestCase;

public class Issue569_1 extends TestCase {
public void test_for_issue() throws Exception {
String json = "{\"result\":{}}";
InterfaceResult<Value> result = JSON.parseObject(json, new TypeReference<InterfaceResult<Value>>() {});
assertNotNull(result.getResult());
assertEquals(Value.class, result.getResult().getClass());
}

public static class BaseInterfaceResult {

}

public static class InterfaceResult<T> extends BaseInterfaceResult
{
public T getResult() {
return result;
}

public void setResult(T result) {
this.result = result;
}

private T result;
}

public static class Value {

}
}

0 comments on commit 00bbb28

Please sign in to comment.