Skip to content

Commit

Permalink
Fixed formatting violations
Browse files Browse the repository at this point in the history
  • Loading branch information
mfriesen committed Nov 17, 2024
1 parent 94c9ea2 commit 4ebc2c7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions gson/src/test/java/com/google/gson/functional/NamingPolicyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,22 @@ public void testAtSignInSerializedName() {

@Test
public void testGsonWithAlternateNamesDeserialiation() {
Gson gson = builder.setFieldNamingStrategy(new FieldNamingStrategy() {

@Override
public String translateName(Field f) {
return "badname";
}

@Override
public List<String> translateToAlternateNames(Field f) {
return List.of("SomeConstantStringInstanceField");
}
}).create();
Gson gson =
builder
.setFieldNamingStrategy(
new FieldNamingStrategy() {

@Override
public String translateName(Field f) {
return "badname";
}

@Override
public List<String> translateToAlternateNames(Field f) {
return List.of("SomeConstantStringInstanceField");
}
})
.create();
String target = "{\"SomeConstantStringInstanceField\":\"someValue\"}";
StringWrapper deserializedObject = gson.fromJson(target, StringWrapper.class);
assertThat(deserializedObject.someConstantStringInstanceField).isEqualTo("someValue");
Expand Down

0 comments on commit 4ebc2c7

Please sign in to comment.