@Test public void should_find_artifact_id() throws Exception { String pomUrl = fr.norad.visuwall.providers.common.ClasspathFiles.getAbsolutePathFile("pom-sample.xml"); Document document = new fr.norad.visuwall.providers.common.DocumentLoader().loadFromUrl(pomUrl); when(documentLoader.loadFromUrl(anyString())).thenReturn(document); String artifactId = maven.findMavenIdFrom("test-project"); assertEquals("fr.norad.visuwall:visuwall-hudsonclient", artifactId); }
public String findMavenIdFrom(String pomUrl) throws MavenIdNotFoundException { try { Document document = documentLoader.loadFromUrl(pomUrl); return findMavenId(document); } catch (DocumentNotLoadedException e) { throw new MavenIdNotFoundException("Can't find pom at " + pomUrl, e); } }
Maven { public String findMavenIdFrom(String pomUrl) throws MavenIdNotFoundException { try { Document document = documentLoader.loadFromUrl(pomUrl); return findMavenId(document); } catch (DocumentNotLoadedException e) { throw new MavenIdNotFoundException("Can't find pom at " + pomUrl, e); } } }
Maven { public String findMavenIdFrom(String pomUrl) throws MavenIdNotFoundException { try { Document document = documentLoader.loadFromUrl(pomUrl); return findMavenId(document); } catch (DocumentNotLoadedException e) { throw new MavenIdNotFoundException("Can't find pom at " + pomUrl, e); } }  }
Maven { public String findMavenIdFrom(String pomUrl) throws MavenIdNotFoundException { try { Document document = documentLoader.loadFromUrl(pomUrl); return findMavenId(document); } catch (DocumentNotLoadedException e) { throw new MavenIdNotFoundException("Can't find pom at " + pomUrl, e); } }  String findMavenIdFrom(String pomUrl); String findMavenIdFromContent(String pomContent); }
Maven { public String findMavenIdFrom(String pomUrl) throws MavenIdNotFoundException { try { Document document = documentLoader.loadFromUrl(pomUrl); return findMavenId(document); } catch (DocumentNotLoadedException e) { throw new MavenIdNotFoundException("Can't find pom at " + pomUrl, e); } }  String findMavenIdFrom(String pomUrl); String findMavenIdFromContent(String pomContent);  }