@Test public void shouldGetByKey() throws Exception { ConfigurationSetting expectedConfiguration = new ConfigurationSetting(); expectedConfiguration.setKey("COUNTRY"); when(mapper.getByKey("123")).thenReturn(expectedConfiguration); ConfigurationSetting actual = repository.getByKey("123"); verify(mapper).getByKey("123"); assertEquals(actual.getKey(), expectedConfiguration.getKey()); }
public ConfigurationSetting getByKey(String key) { return mapper.getByKey(key); }
ConfigurationSettingRepository { public ConfigurationSetting getByKey(String key) { return mapper.getByKey(key); } }
ConfigurationSettingRepository { public ConfigurationSetting getByKey(String key) { return mapper.getByKey(key); } @Autowired  ConfigurationSettingRepository(ConfigurationSettingMapper configurationSettingMapper); }
ConfigurationSettingRepository { public ConfigurationSetting getByKey(String key) { return mapper.getByKey(key); } @Autowired  ConfigurationSettingRepository(ConfigurationSettingMapper configurationSettingMapper); ConfigurationSetting getByKey(String key); List<ConfigurationSetting> getAll(); void setValue(ConfigurationSetting config); List<ConfigurationSetting> getSearchResults(String s); }
ConfigurationSettingRepository { public ConfigurationSetting getByKey(String key) { return mapper.getByKey(key); } @Autowired  ConfigurationSettingRepository(ConfigurationSettingMapper configurationSettingMapper); ConfigurationSetting getByKey(String key); List<ConfigurationSetting> getAll(); void setValue(ConfigurationSetting config); List<ConfigurationSetting> getSearchResults(String s);  }