Skip to content

Commit

Permalink
Update gson/src/test/java/com/google/gson/ToNumberPolicyTest.java
Browse files Browse the repository at this point in the history
Co-authored-by: Marcono1234 <[email protected]>
  • Loading branch information
elevne and Marcono1234 committed Jul 29, 2023
1 parent d8a4c62 commit 87c20bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gson/src/test/java/com/google/gson/ToNumberPolicyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,19 @@ public void testBigDecimal() throws IOException {
public void testNullsAreNeverExpected() throws IOException {
IllegalStateException e = assertThrows(IllegalStateException.class, () -> ToNumberPolicy.DOUBLE.readNumber(fromString("null")));
assertThat(e).hasMessageThat().isEqualTo("Expected a double but was NULL at line 1 column 5 path $"
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");

e = assertThrows(IllegalStateException.class, () -> ToNumberPolicy.LAZILY_PARSED_NUMBER.readNumber(fromString("null")));
assertThat(e).hasMessageThat().isEqualTo("Expected a string but was NULL at line 1 column 5 path $"
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");

e = assertThrows(IllegalStateException.class, () -> ToNumberPolicy.LONG_OR_DOUBLE.readNumber(fromString("null")));
assertThat(e).hasMessageThat().isEqualTo("Expected a string but was NULL at line 1 column 5 path $"
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");

e = assertThrows(IllegalStateException.class, () -> ToNumberPolicy.BIG_DECIMAL.readNumber(fromString("null")));
assertThat(e).hasMessageThat().isEqualTo("Expected a string but was NULL at line 1 column 5 path $"
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");
+ "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#adapter-not-null-safe");
}

private static JsonReader fromString(String json) {
Expand Down

0 comments on commit 87c20bc

Please sign in to comment.