assertEquals(person, returned);
}
@Test
public void searchWhenSearchTypeIsMethodName() {
SearchDTO searchCriteria = createSearchDTO(LAST_NAME, SearchType.METHOD_NAME);
List<Person> expected = new ArrayList<Person>();
when(personRepositoryMock.findByLastName(searchCriteria.getSearchTerm())).thenReturn(expected);
List<Person> actual = personService.search(searchCriteria);
verify(personRepositoryMock, times(1)).findByLastName(searchCriteria.getSearchTerm());
verifyNoMoreInteractions(personRepositoryMock);
assertEquals(expected, actual);
}