Browse Source

Adopt to Mockito 5.1 changes.

See #4290
4.0.x
Mark Paluch 3 years ago
parent
commit
b9a23baf16
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 13
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/support/SimpleReactiveMongoRepositoryUnitTests.java

13
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/support/SimpleReactiveMongoRepositoryUnitTests.java

@ -28,7 +28,6 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.data.domain.Example; import org.springframework.data.domain.Example;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.ReactiveMongoOperations; import org.springframework.data.mongodb.core.ReactiveMongoOperations;
@ -43,8 +42,6 @@ import org.springframework.data.mongodb.repository.query.MongoEntityInformation;
class SimpleReactiveMongoRepositoryUnitTests { class SimpleReactiveMongoRepositoryUnitTests {
private SimpleReactiveMongoRepository<Object, String> repository; private SimpleReactiveMongoRepository<Object, String> repository;
@Mock Mono mono;
@Mock Flux flux;
@Mock ReactiveMongoOperations mongoOperations; @Mock ReactiveMongoOperations mongoOperations;
@Mock MongoEntityInformation<Object, String> entityInformation; @Mock MongoEntityInformation<Object, String> entityInformation;
@ -56,7 +53,7 @@ class SimpleReactiveMongoRepositoryUnitTests {
@Test // DATAMONGO-1854 @Test // DATAMONGO-1854
void shouldAddDefaultCollationToCountForExampleIfPresent() { void shouldAddDefaultCollationToCountForExampleIfPresent() {
when(mongoOperations.count(any(), any(), any())).thenReturn(mono); when(mongoOperations.count(any(), any(), any())).thenReturn(Mono.just(0L));
Collation collation = Collation.of("en_US"); Collation collation = Collation.of("en_US");
@ -72,7 +69,7 @@ class SimpleReactiveMongoRepositoryUnitTests {
@Test // DATAMONGO-1854 @Test // DATAMONGO-1854
void shouldAddDefaultCollationToExistsForExampleIfPresent() { void shouldAddDefaultCollationToExistsForExampleIfPresent() {
when(mongoOperations.exists(any(), any(), any())).thenReturn(mono); when(mongoOperations.exists(any(), any(), any())).thenReturn(Mono.just(false));
Collation collation = Collation.of("en_US"); Collation collation = Collation.of("en_US");
@ -88,7 +85,7 @@ class SimpleReactiveMongoRepositoryUnitTests {
@Test // DATAMONGO-1854 @Test // DATAMONGO-1854
void shouldAddDefaultCollationToFindForExampleIfPresent() { void shouldAddDefaultCollationToFindForExampleIfPresent() {
when(mongoOperations.find(any(), any(), any())).thenReturn(flux); when(mongoOperations.find(any(), any(), any())).thenReturn(Flux.empty());
Collation collation = Collation.of("en_US"); Collation collation = Collation.of("en_US");
@ -104,7 +101,7 @@ class SimpleReactiveMongoRepositoryUnitTests {
@Test // DATAMONGO-1854 @Test // DATAMONGO-1854
void shouldAddDefaultCollationToFindWithSortForExampleIfPresent() { void shouldAddDefaultCollationToFindWithSortForExampleIfPresent() {
when(mongoOperations.find(any(), any(), any())).thenReturn(flux); when(mongoOperations.find(any(), any(), any())).thenReturn(Flux.empty());
Collation collation = Collation.of("en_US"); Collation collation = Collation.of("en_US");
@ -120,7 +117,7 @@ class SimpleReactiveMongoRepositoryUnitTests {
@Test // DATAMONGO-1854 @Test // DATAMONGO-1854
void shouldAddDefaultCollationToFindOneForExampleIfPresent() { void shouldAddDefaultCollationToFindOneForExampleIfPresent() {
when(mongoOperations.find(any(), any(), any())).thenReturn(flux); when(mongoOperations.find(any(), any(), any())).thenReturn(Flux.empty());
Collation collation = Collation.of("en_US"); Collation collation = Collation.of("en_US");

Loading…
Cancel
Save