Browse Source

Add nullability annotations to tests in module/spring-boot-graphql-test

See gh-47263
pull/47415/head
Moritz Halbritter 3 months ago
parent
commit
9f1e033caf
  1. 4
      module/spring-boot-graphql-test/build.gradle
  2. 6
      module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/Book.java
  3. 4
      module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilterTests.java

4
module/spring-boot-graphql-test/build.gradle

@ -48,3 +48,7 @@ dependencies { @@ -48,3 +48,7 @@ dependencies {
testRuntimeOnly("ch.qos.logback:logback-classic")
testRuntimeOnly("tools.jackson.core:jackson-databind")
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}

6
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; @@ -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) {

4
module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilterTests.java

@ -192,7 +192,7 @@ class GraphQlTypeExcludeFilterTests { @@ -192,7 +192,7 @@ class GraphQlTypeExcludeFilterTests {
@Override
public Mono<WebGraphQlResponse> intercept(WebGraphQlRequest request, Chain chain) {
return null;
return Mono.empty();
}
}
@ -206,7 +206,7 @@ class GraphQlTypeExcludeFilterTests { @@ -206,7 +206,7 @@ class GraphQlTypeExcludeFilterTests {
@Override
public Mono<List<GraphQLError>> resolveException(Throwable exception, DataFetchingEnvironment environment) {
return null;
return Mono.empty();
}
}

Loading…
Cancel
Save