@Test public void shouldGetZoneByCode() throws Exception { GeographicZone expected = new GeographicZone(); when(mapper.getGeographicZoneByCode("code")).thenReturn(expected); GeographicZone zone = repository.getByCode("code"); assertThat(expected, is(zone)); verify(mapper).getGeographicZoneByCode("code"); }
public GeographicZone getByCode(String code) { return mapper.getGeographicZoneByCode(code); }
GeographicZoneRepository { public GeographicZone getByCode(String code) { return mapper.getGeographicZoneByCode(code); } }
GeographicZoneRepository { public GeographicZone getByCode(String code) { return mapper.getGeographicZoneByCode(code); } @Autowired  GeographicZoneRepository(GeographicZoneMapper mapper, GeographicLevelRepository geographicLevelRepository); }
GeographicZoneRepository { public GeographicZone getByCode(String code) { return mapper.getGeographicZoneByCode(code); } @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 getByCode(String code) { return mapper.getGeographicZoneByCode(code); } @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);  }