@Test public void shouldGetGeographicZoneById() { GeographicZone expectedGeographicZone = new GeographicZone(); Long geographicZoneId = 1l; when(mapper.getWithParentById(geographicZoneId)).thenReturn(expectedGeographicZone); GeographicZone actualGeographicZone = repository.getById(geographicZoneId); assertThat(actualGeographicZone, is(expectedGeographicZone)); verify(mapper).getWithParentById(geographicZoneId); }
public GeographicZone getById(Long id) { return mapper.getWithParentById(id); }
GeographicZoneRepository { public GeographicZone getById(Long id) { return mapper.getWithParentById(id); } }
GeographicZoneRepository { public GeographicZone getById(Long id) { return mapper.getWithParentById(id); } @Autowired  GeographicZoneRepository(GeographicZoneMapper mapper, GeographicLevelRepository geographicLevelRepository); }
GeographicZoneRepository { public GeographicZone getById(Long id) { return mapper.getWithParentById(id); } @Autowired  GeographicZoneRepository(GeographicZoneMapper mapper, GeographicLevelRepository geographicLevelRepository); GeographicZone getByCode(String code); Integer getLowestGeographicLevel(); List<GeographicZone> getAllGeographicZones(); void save(GeographicZone zone); GeographicZone getById(Long id); List<GeographicZone> searchByParentName(String searchParam, Pagination pagination); List<GeographicZone> searchByName(String searchParam, Pagination pagination); List<GeographicLevel> getAllGeographicLevels(); List<GeographicZone> getAllGeographicZonesAbove(GeographicLevel geographicLevel); Integer getTotalParentSearchResultCount(String param); Integer getTotalSearchResultCount(String param); List<GeographicZone> getGeographicZonesByCodeOrName(String searchParam); Integer getGeographicZonesCountBy(String searchParam); }
GeographicZoneRepository { public GeographicZone getById(Long id) { return mapper.getWithParentById(id); } @Autowired  GeographicZoneRepository(GeographicZoneMapper mapper, GeographicLevelRepository geographicLevelRepository); GeographicZone getByCode(String code); Integer getLowestGeographicLevel(); List<GeographicZone> getAllGeographicZones(); void save(GeographicZone zone); GeographicZone getById(Long id); List<GeographicZone> searchByParentName(String searchParam, Pagination pagination); List<GeographicZone> searchByName(String searchParam, Pagination pagination); List<GeographicLevel> getAllGeographicLevels(); List<GeographicZone> getAllGeographicZonesAbove(GeographicLevel geographicLevel); Integer getTotalParentSearchResultCount(String param); Integer getTotalSearchResultCount(String param); List<GeographicZone> getGeographicZonesByCodeOrName(String searchParam); Integer getGeographicZonesCountBy(String searchParam);  }