@Test public void shouldGetGeographicLevel() throws Exception { GeographicLevel expectedLevel = new GeographicLevel(); expectedLevel.setCode("code"); when(mapper.getGeographicLevelById(1)).thenReturn(expectedLevel); GeographicLevel actual = repo.getGeographicLevel(1); verify(mapper).getGeographicLevelById(1); assertEquals(actual.getCode(), "code"); }
public GeographicLevel getGeographicLevel (int geographicLevelID){ return mapper.getGeographicLevelById(geographicLevelID); }
GeographicLevelRepository { public GeographicLevel getGeographicLevel (int geographicLevelID){ return mapper.getGeographicLevelById(geographicLevelID); } }
GeographicLevelRepository { public GeographicLevel getGeographicLevel (int geographicLevelID){ return mapper.getGeographicLevelById(geographicLevelID); } @Autowired  GeographicLevelRepository(GeographicLevelMapper mapper); }
GeographicLevelRepository { public GeographicLevel getGeographicLevel (int geographicLevelID){ return mapper.getGeographicLevelById(geographicLevelID); } @Autowired  GeographicLevelRepository(GeographicLevelMapper mapper); int getLowestGeographicLevel(); GeographicLevel getGeographicLevelByCode(String code); List<GeographicLevel> getAll(); GeographicLevel getByCode(String code); void save(GeographicLevel geographicLevel); GeographicLevel getGeographicLevel(int geographicLevelID); }
GeographicLevelRepository { public GeographicLevel getGeographicLevel (int geographicLevelID){ return mapper.getGeographicLevelById(geographicLevelID); } @Autowired  GeographicLevelRepository(GeographicLevelMapper mapper); int getLowestGeographicLevel(); GeographicLevel getGeographicLevelByCode(String code); List<GeographicLevel> getAll(); GeographicLevel getByCode(String code); void save(GeographicLevel geographicLevel); GeographicLevel getGeographicLevel(int geographicLevelID);  }