Skip to content

Commit

Permalink
Use better names for lambda parameters in tests (#2770)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 authored Oct 20, 2024
1 parent 2dc29f7 commit e430a3d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ public void testCustomSerializerInvokedForPrimitives() {
Gson gson =
new GsonBuilder()
.registerTypeAdapter(
boolean.class, (JsonSerializer<Boolean>) (s, t, c) -> new JsonPrimitive(s ? 1 : 0))
boolean.class,
(JsonSerializer<Boolean>)
(value, type, context) -> new JsonPrimitive(value ? 1 : 0))
.create();
assertThat(gson.toJson(true, boolean.class)).isEqualTo("1");
assertThat(gson.toJson(true, Boolean.class)).isEqualTo("true");
Expand All @@ -248,7 +250,7 @@ public void testCustomDeserializerInvokedForPrimitives() {
new GsonBuilder()
.registerTypeAdapter(
boolean.class,
(JsonDeserializer<Boolean>) (json, t, context) -> json.getAsInt() != 0)
(JsonDeserializer<Boolean>) (json, type, context) -> json.getAsInt() != 0)
.create();
assertThat(gson.fromJson("1", boolean.class)).isEqualTo(Boolean.TRUE);
assertThat(gson.fromJson("true", Boolean.class)).isEqualTo(Boolean.TRUE);
Expand Down

0 comments on commit e430a3d

Please sign in to comment.