Suppress @Nullable usage warnings in GraphQL tests
See gh-45494
This commit is contained in:
committed by
Phillip Webb
parent
564bfeef95
commit
e7b4f65c68
@@ -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);
|
||||
|
||||
@@ -169,6 +169,7 @@ class GraphQlWebFluxSecurityAutoConfigurationTests {
|
||||
|
||||
@PreAuthorize("hasRole('USER')")
|
||||
@Nullable
|
||||
@SuppressWarnings("deprecation")
|
||||
Mono<Book> getBookdById(String id) {
|
||||
return Mono.justOrEmpty(GraphQlTestDataFetchers.getBookById(id));
|
||||
}
|
||||
|
||||
@@ -158,6 +158,7 @@ class GraphQlWebMvcSecurityAutoConfigurationTests {
|
||||
|
||||
@PreAuthorize("hasRole('USER')")
|
||||
@Nullable
|
||||
@SuppressWarnings("deprecation")
|
||||
Book getBookdById(String id) {
|
||||
return GraphQlTestDataFetchers.getBookById(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user