mirror of
https://github.com/octoleo/plantuml-server.git
synced 2024-06-02 00:20:48 +00:00
e5d11fb89a
- PDF dependency was missing in the pom file the JDK8 * We should think about creating a parent pom - in that case all plantuml dependencies could be in the parent pom and we would only the mantain one pom file. (It is also possible to drop the Java 8 support.) * Why do we not have any PDF tests? - add rule to ignore version update hint with `-dev` followed by a dot and date (e.g. `0.37.0-dev.20230308`) - migration from JUnit4 to JUnit5
38 lines
1.2 KiB
Java
38 lines
1.2 KiB
Java
package net.sourceforge.plantuml.servlet;
|
|
|
|
import java.io.IOException;
|
|
import java.net.URL;
|
|
import java.net.URLConnection;
|
|
|
|
import org.junit.jupiter.api.Assertions;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import net.sourceforge.plantuml.servlet.utils.TestUtils;
|
|
import net.sourceforge.plantuml.servlet.utils.WebappTestCase;
|
|
|
|
|
|
public class TestAsciiArt extends WebappTestCase {
|
|
|
|
/**
|
|
* Verifies the generation of the ascii art for the Bob -> Alice sample
|
|
*/
|
|
@Test
|
|
public void testSimpleSequenceDiagram() throws IOException {
|
|
final URL url = new URL(getServerUrl() + "/txt/" + TestUtils.SEQBOB);
|
|
final URLConnection conn = url.openConnection();
|
|
// Analyze response
|
|
// Verifies the Content-Type header
|
|
Assertions.assertEquals(
|
|
"text/plain;charset=utf-8",
|
|
conn.getContentType().toLowerCase(),
|
|
"Response content type is not TEXT PLAIN or UTF-8"
|
|
);
|
|
// Get the content and verify its size
|
|
String diagram = getContentText(conn);
|
|
int diagramLen = diagram.length();
|
|
Assertions.assertTrue(diagramLen > 200);
|
|
Assertions.assertTrue(diagramLen < 250);
|
|
}
|
|
|
|
}
|