@Override
	void toHtml() throws IOException {
		writeBackLink();
		writeln("<br/>");

		if (dependencies.isEmpty()) {
			writeln("#Aucune_dependance#");
			return;
		}
		writeTitle("beans.png", getString("Dependencies"));
		final HtmlTable table = new HtmlTable();
		table.beginTable(getString("Dependencies"));
		// table of dependencies inspired by Jenkins "/about"
		write("<th>Artifact</th><th>#Nom#</th><th>Maven ID</th><th>#Licence#</th>");
		for (final Map.Entry<String, MavenArtifact> entry : dependencies.entrySet()) {
			final String jarFilename = entry.getKey();
			final MavenArtifact dependency = entry.getValue();
			table.nextRow();
			writeDependency(jarFilename, dependency);
		}
		table.endTable();
		writeln("<div align='right'>" + getFormattedString("nb_dependencies", dependencies.size())
				+ "</div>");
	}
@Test
	public void testDependencies() throws IOException {
		final ServletContext context = createNiceMock(ServletContext.class);
		final String javamelodyDir = "/META-INF/maven/net.bull.javamelody/";
		final String webapp = javamelodyDir + "javamelody-test-webapp/";
		expect(context.getResourcePaths("/META-INF/maven/"))
				.andReturn(Collections.singleton(javamelodyDir)).anyTimes();
		expect(context.getResourcePaths(javamelodyDir)).andReturn(Collections.singleton(webapp))
				.anyTimes();
		final IAnswer<InputStream> answer = () -> getClass().getResourceAsStream("/pom.xml");
		expect(context.getResourceAsStream(webapp + "pom.xml")).andAnswer(answer).anyTimes();
		final Set<String> dependencies = new LinkedHashSet<>(
				List.of("/WEB-INF/lib/jrobin-1.5.9.jar", "/WEB-INF/lib/javamelody-core-1.65.0.jar",
						"/WEB-INF/lib/nothing.jar"));
		expect(context.getResourcePaths("/WEB-INF/lib/")).andReturn(dependencies).anyTimes();
		expect(context.getMajorVersion()).andReturn(5).anyTimes();
		expect(context.getMinorVersion()).andReturn(0).anyTimes();
		replay(context);
		Parameters.initialize(context);
		final Map<String, MavenArtifact> webappDependencies = MavenArtifact.getWebappDependencies();
		assertFalse("getWebappDependencies", webappDependencies.isEmpty());
		verify(context);

		final StringWriter writer = new StringWriter();
		final HtmlDependenciesReport htmlDependenciesReport = new HtmlDependenciesReport(
				webappDependencies, writer);
		htmlDependenciesReport.toHtml();
		assertNotEmptyAndClear(writer);
	}