Added a test for deserialization of fields using lowercase-dot naming policy (#1303)
This commit is contained in:
parent
ab35f11077
commit
1b28ff3cda
@ -70,6 +70,12 @@ public class NamingPolicyTest extends TestCase {
|
||||
+ target.someConstantStringInstanceField + "\"}", gson.toJson(target));
|
||||
}
|
||||
|
||||
public void testGsonWithLowerCaseDotPolicyDeserialiation() {
|
||||
Gson gson = builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_DOTS).create();
|
||||
String target = "{\"some.constant.string.instance.field\":\"someValue\"}";
|
||||
StringWrapper deserializedObject = gson.fromJson(target, StringWrapper.class);
|
||||
assertEquals("someValue", deserializedObject.someConstantStringInstanceField);
|
||||
}
|
||||
|
||||
public void testGsonWithLowerCaseDashPolicyDeserialiation() {
|
||||
Gson gson = builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_DASHES).create();
|
||||
|
Loading…
Reference in New Issue
Block a user