From 46221c6d1730ee5de43e20c89ba3f2c72762f9f6 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 29 Jun 2021 14:33:00 +0100 Subject: [PATCH] Adjust mock expectations for QuerydslDataFetcher See gh-71 --- .../graphql/data/QuerydslDataFetcherTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-graphql/src/test/java/org/springframework/graphql/data/QuerydslDataFetcherTests.java b/spring-graphql/src/test/java/org/springframework/graphql/data/QuerydslDataFetcherTests.java index 653520cb..ce8b7fe4 100644 --- a/spring-graphql/src/test/java/org/springframework/graphql/data/QuerydslDataFetcherTests.java +++ b/spring-graphql/src/test/java/org/springframework/graphql/data/QuerydslDataFetcherTests.java @@ -73,7 +73,7 @@ class QuerydslDataFetcherTests { MockRepository mockRepository = mock(MockRepository.class); Book book1 = new Book(42L, "Hitchhiker's Guide to the Galaxy", "Douglas Adams"); Book book2 = new Book(53L, "Breaking Bad", "Heisenberg"); - when(mockRepository.findAll((Predicate) null)).thenReturn(Arrays.asList(book1, book2)); + when(mockRepository.findAll(any(Predicate.class))).thenReturn(Arrays.asList(book1, book2)); WebGraphQlHandler handler = initWebGraphQlHandler(builder -> builder .dataFetcher("books", QuerydslDataFetcher.builder(mockRepository).many())); @@ -169,7 +169,7 @@ class QuerydslDataFetcherTests { ReactiveMockRepository mockRepository = mock(ReactiveMockRepository.class); Book book1 = new Book(42L, "Hitchhiker's Guide to the Galaxy", "Douglas Adams"); Book book2 = new Book(53L, "Breaking Bad", "Heisenberg"); - when(mockRepository.findAll((Predicate) null)).thenReturn(Flux.just(book1, book2)); + when(mockRepository.findAll((Predicate) any())).thenReturn(Flux.just(book1, book2)); WebGraphQlHandler handler = initWebGraphQlHandler(builder -> builder .dataFetcher("books", QuerydslDataFetcher.builder(mockRepository).many()));