mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Add nullability annotations to tests in module/spring-boot-gson
See gh-47263
This commit is contained in:
@@ -36,3 +36,7 @@ dependencies {
|
||||
|
||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||
}
|
||||
|
||||
tasks.named("compileTestJava") {
|
||||
options.nullability.checking = "tests"
|
||||
}
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.gson.autoconfigure;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
@@ -52,7 +53,7 @@ class Gson210AutoConfigurationTests {
|
||||
private Long data = 1L;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final String owner = null;
|
||||
private final @Nullable String owner = null;
|
||||
|
||||
public void setData(Long data) {
|
||||
this.data = data;
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.LongSerializationPolicy;
|
||||
import com.google.gson.Strictness;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.skyscreamer.jsonassert.JSONAssert;
|
||||
|
||||
@@ -310,7 +311,7 @@ class GsonAutoConfigurationTests {
|
||||
private Long data = 1L;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final String owner = null;
|
||||
private final @Nullable String owner = null;
|
||||
|
||||
public void setData(Long data) {
|
||||
this.data = data;
|
||||
|
||||
Reference in New Issue
Block a user