Skip to content

Commit

Permalink
Reduce dependencies of test helper classes. (#2796)
Browse files Browse the repository at this point in the history
  • Loading branch information
eamonnmcmanus authored Jan 30, 2025
1 parent 5ccd7fb commit 28aff47
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;

import com.google.gson.functional.FieldNamingTest;
import java.lang.reflect.Field;
import java.util.Locale;
import org.junit.Test;

/**
* Performs tests directly against {@link FieldNamingPolicy}; for integration tests see {@link
* Performs tests directly against {@link FieldNamingPolicy}; for integration tests see {@code
* FieldNamingTest}.
*/
public class FieldNamingPolicyTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package com.google.gson;

import com.google.common.base.Objects;
import com.google.gson.internal.$Gson$Types;
import com.google.gson.internal.Primitives;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Objects;

/**
* This class contains some test fixtures for Parameterized types. These classes should ideally
Expand Down Expand Up @@ -82,7 +82,7 @@ public boolean equals(Object obj) {
return false;
}
MyParameterizedType<?> that = (MyParameterizedType<?>) obj;
return Objects.equal(getValue(), that.getValue());
return Objects.equals(getValue(), that.getValue());
}
}

Expand Down
4 changes: 2 additions & 2 deletions gson/src/test/java/com/google/gson/common/TestTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.gson.common;

import com.google.common.base.Objects;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
Expand All @@ -28,6 +27,7 @@
import com.google.gson.annotations.SerializedName;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Objects;

/**
* Types used for testing JSON serialization and deserialization
Expand Down Expand Up @@ -165,7 +165,7 @@ public boolean equals(Object o) {
return longValue == that.longValue
&& getIntValue() == that.getIntValue()
&& booleanValue == that.booleanValue
&& Objects.equal(stringValue, that.stringValue);
&& Objects.equals(stringValue, that.stringValue);
}

@Override
Expand Down

0 comments on commit 28aff47

Please sign in to comment.