Suppress @Nullable usage warnings in GraphQL tests

See gh-45494
This commit is contained in:
Stéphane Nicoll
2025-05-08 21:43:49 -07:00
committed by Phillip Webb
parent 564bfeef95
commit e7b4f65c68
3 changed files with 4 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,6 +48,7 @@ public final class GraphQlTestDataFetchers {
return (environment) -> getBooksOnSale(environment.getArgument("minPages"));
}
@SuppressWarnings("deprecation")
@Nullable
public static Book getBookById(String id) {
return books.stream().filter((book) -> book.getId().equals(id)).findFirst().orElse(null);

View File

@@ -169,6 +169,7 @@ class GraphQlWebFluxSecurityAutoConfigurationTests {
@PreAuthorize("hasRole('USER')")
@Nullable
@SuppressWarnings("deprecation")
Mono<Book> getBookdById(String id) {
return Mono.justOrEmpty(GraphQlTestDataFetchers.getBookById(id));
}

View File

@@ -158,6 +158,7 @@ class GraphQlWebMvcSecurityAutoConfigurationTests {
@PreAuthorize("hasRole('USER')")
@Nullable
@SuppressWarnings("deprecation")
Book getBookdById(String id) {
return GraphQlTestDataFetchers.getBookById(id);
}