Add metadata Servlet

- add new servlet to get meta data from PlantUML diagram
- meta data get not only be requested as text but also as json if you set the `Accept`-header to json
- add `metadata` servlet tests
- GET: like the Proxy where you can pass a URL which the servlet will use to fetch the diagram image
- POST: file upload
This commit is contained in:
Florian
2023-05-11 20:58:36 +02:00
committed by PlantUML
parent 09517cca92
commit ec7b9f9b1a
13 changed files with 594 additions and 22 deletions

View File

@@ -12,12 +12,14 @@ import net.sourceforge.plantuml.servlet.utils.WebappTestCase;
public class TestOldProxy extends WebappTestCase {
private static final String TEST_RESOURCE = "test2diagrams.txt";
/**
* Verifies the proxified reception of the default Bob and Alice diagram
*/
@Test
public void testDefaultProxy() throws IOException {
final URL url = new URL(getServerUrl() + "/proxy/" + getTestDiagramUrl());
final URL url = new URL(getServerUrl() + "/proxy/" + getTestResourceUrl(TEST_RESOURCE));
final HttpURLConnection conn = (HttpURLConnection)url.openConnection();
// Analyze response
// Verifies HTTP status code and the Content-Type
@@ -39,7 +41,7 @@ public class TestOldProxy extends WebappTestCase {
*/
@Test
public void testProxyWithFormat() throws IOException {
final URL url = new URL(getServerUrl() + "/proxy/svg/" + getTestDiagramUrl());
final URL url = new URL(getServerUrl() + "/proxy/svg/" + getTestResourceUrl(TEST_RESOURCE));
final HttpURLConnection conn = (HttpURLConnection)url.openConnection();
// Analyze response
// Verifies HTTP status code and the Content-Type