diff --git a/module/spring-boot-graphql-test/build.gradle b/module/spring-boot-graphql-test/build.gradle index bdd286d63f9..b6b2e0e31b9 100644 --- a/module/spring-boot-graphql-test/build.gradle +++ b/module/spring-boot-graphql-test/build.gradle @@ -48,3 +48,7 @@ dependencies { testRuntimeOnly("ch.qos.logback:logback-classic") testRuntimeOnly("tools.jackson.core:jackson-databind") } + +tasks.named("compileTestJava") { + options.nullability.checking = "tests" +} diff --git a/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/Book.java b/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/Book.java index c9d1913c3ae..0da0f4c3ccf 100644 --- a/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/Book.java +++ b/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/Book.java @@ -18,15 +18,19 @@ package org.springframework.boot.graphql.test.autoconfigure; public class Book { + @SuppressWarnings("NullAway.Init") String id; + @SuppressWarnings("NullAway.Init") String name; + @SuppressWarnings("NullAway.Init") int pageCount; + @SuppressWarnings("NullAway.Init") String author; - public Book() { + protected Book() { } public Book(String id, String name, int pageCount, String author) { diff --git a/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilterTests.java b/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilterTests.java index a00de165f73..51d34608091 100644 --- a/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilterTests.java +++ b/module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilterTests.java @@ -192,7 +192,7 @@ class GraphQlTypeExcludeFilterTests { @Override public Mono intercept(WebGraphQlRequest request, Chain chain) { - return null; + return Mono.empty(); } } @@ -206,7 +206,7 @@ class GraphQlTypeExcludeFilterTests { @Override public Mono> resolveException(Throwable exception, DataFetchingEnvironment environment) { - return null; + return Mono.empty(); } }