@Test public void shouldGetGeoZoneById() throws Exception { GeographicZone expected = new GeographicZone(1L, "Root", "Root", null, null); when(repository.getById(1L)).thenReturn(expected); GeographicZone actual = service.getById(1L); assertThat(actual, is(expected)); verify(repository).getById(1L); }
public GeographicZone getById(Long id) { return repository.getById(id); }
GeographicZoneService { public GeographicZone getById(Long id) { return repository.getById(id); } }
GeographicZoneService { public GeographicZone getById(Long id) { return repository.getById(id); }  }
GeographicZoneService { public GeographicZone getById(Long id) { return repository.getById(id); }  @Autowired void setPageSize(@Value("${search.page.size}") String pageSize); void save(GeographicZone geographicZone); GeographicZone getByCode(GeographicZone geographicZone); GeographicZone getById(Long id); List<GeographicZone> searchBy(String searchParam, String columnName, Integer page); List<GeographicLevel> getAllGeographicLevels(); List<GeographicZone> getAllGeographicZonesAbove(GeographicLevel level); Pagination getPagination(Integer page); Integer getTotalSearchResultCount(String param, String columnName); List<GeographicZone> getGeographicZonesByCodeOrName(String searchParam); Integer getGeographicZonesCountBy(String searchParam); void saveGisInfo(List<GeographicZoneGeometry> geoZoneGeometries, Long userId); }
GeographicZoneService { public GeographicZone getById(Long id) { return repository.getById(id); }  @Autowired void setPageSize(@Value("${search.page.size}") String pageSize); void save(GeographicZone geographicZone); GeographicZone getByCode(GeographicZone geographicZone); GeographicZone getById(Long id); List<GeographicZone> searchBy(String searchParam, String columnName, Integer page); List<GeographicLevel> getAllGeographicLevels(); List<GeographicZone> getAllGeographicZonesAbove(GeographicLevel level); Pagination getPagination(Integer page); Integer getTotalSearchResultCount(String param, String columnName); List<GeographicZone> getGeographicZonesByCodeOrName(String searchParam); Integer getGeographicZonesCountBy(String searchParam); void saveGisInfo(List<GeographicZoneGeometry> geoZoneGeometries, Long userId);  }