TracingSearchPresenter extends RecordSearchPresenter { @Override protected List<Long> getSearchResult(Map<String, String> searchConditions) { String id = searchConditions.get(ID); String name = searchConditions.get(NAME); int ageFrom = Integer.valueOf(searchConditions.get(AGE_FROM)); int ageTo = Integer.valueOf(searchConditions.get(AGE_TO)); String dateOfInquiry = searchConditions.get(DATE_OF_INQUIRY); return tracingService.getSearchResult(id, name, ageFrom, ageTo, getDate(dateOfInquiry)); } @Inject  TracingSearchPresenter(TracingService tracingService);   }
@Test public void should_get_tracing_list_when_get_search_result() throws Exception { Map<String, String> searchConditions = mock(Map.class); List<Long> list = new ArrayList<>(); when(searchConditions.get(anyString())).thenReturn("0"); when(tracingService.getSearchResult(anyString(),anyString(),anyInt(),anyInt(),any())) .thenReturn(list); assertThat("Should return same list", tracingSearchPresenter.getSearchResult(searchConditions), is(list)); }