SourceService implements ISourceService { @Override public boolean updateSource(Source source) { if (source.getId() < 0) { throw new IllegalArgumentException("Invalid source id"); } if (source.getUrl() == null || source.getUrl().isEmpty()) { throw new IllegalArgumentException("url must not be null or empty"); } if (source.getMaxDownload() > LIMIT_MAX_DOWNLOADS) { throw new IllegalArgumentException( "max concurrent download must be less or equals than " + LIMIT_MAX_DOWNLOADS); } return configurationManager.getSourceManager().updateSource(source); }  @Override int count(); @Override Source createSource(String url, String username, String password, Integer maxDownloads); @Override Source getSource(int sourceId); @Override Source getSource(SynchronizerSource synchronizerSource); @Override List<Source> getSource(List<SynchronizerSource> synchronizerSources); @Override boolean updateSource(Source source); @Override boolean deleteSource(Source source); @Override List<Source> list(); @Override List<Source> sortSources(List<Source> sources); @Override Source getBestSource(List<Source> sources);  }
@Test(dependsOnMethods = {"createSource"}) public void updateSource() { int sourceId = 1; String expectedUrl = "https: Source source = service.getSource(sourceId); source.setUrl("https: Assert.assertTrue(service.updateSource(source)); source = service.getSource(sourceId); Assert.assertEquals(source.getUrl(), expectedUrl); }