소스 검색

Person Find All sorted (error in test fixed)
Fixes #49

Andrew Grant 6 달 전
부모
커밋
14d7ed025e
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/test/java/scot/carricksoftware/grants/services/people/PersonServiceFindTest.java

+ 3 - 1
src/test/java/scot/carricksoftware/grants/services/people/PersonServiceFindTest.java

@@ -10,6 +10,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
+import org.springframework.data.domain.Sort;
 import scot.carricksoftware.grants.converters.people.PersonCommandConverterImpl;
 import scot.carricksoftware.grants.converters.people.PersonConverterImpl;
 import scot.carricksoftware.grants.domains.people.Person;
@@ -21,6 +22,7 @@ import java.util.Optional;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
@@ -50,7 +52,7 @@ public class PersonServiceFindTest {
     public void testFindAll() {
         List<Person> countries = new ArrayList<>();
         countries.add(GetRandomPerson());
-        when(personRepositoryMock.findAll()).thenReturn(countries);
+        when(personRepositoryMock.findAll((Sort) any())).thenReturn(countries);
         assertEquals(countries, personService.findAll());
     }