update all dependencies (maven artifacts)

- 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
This commit is contained in:
Florian
2023-05-05 17:50:02 +02:00
committed by PlantUML
parent e6566b58bd
commit e5d11fb89a
20 changed files with 435 additions and 359 deletions

View File

@@ -6,6 +6,9 @@ import java.net.HttpURLConnection;
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;
@@ -15,24 +18,26 @@ public class TestAsciiCoder extends WebappTestCase {
/**
* Verifies the decoding for the Bob -> Alice sample
*/
@Test
public void testBobAliceSampleDiagramDecoding() throws IOException {
final URL url = new URL(getServerUrl() + "/coder/" + TestUtils.SEQBOB);
final URLConnection conn = url.openConnection();
// Analyze response
// Verifies the Content-Type header
assertEquals(
"Response content type is not TEXT PLAIN or UTF-8",
Assertions.assertEquals(
"text/plain;charset=utf-8",
conn.getContentType().toLowerCase()
conn.getContentType().toLowerCase(),
"Response content type is not TEXT PLAIN or UTF-8"
);
// Get and verify the content
final String diagram = getContentText(conn);
assertEquals(TestUtils.SEQBOBCODE, diagram);
Assertions.assertEquals(TestUtils.SEQBOBCODE, diagram);
}
/**
* Verifies the encoding for the Bob -> Alice sample
*/
@Test
public void testBobAliceSampleDiagramEncoding() throws IOException {
final URL url = new URL(getServerUrl() + "/coder");
final HttpURLConnection conn = (HttpURLConnection)url.openConnection();
@@ -45,20 +50,16 @@ public class TestAsciiCoder extends WebappTestCase {
}
// Analyze response
// HTTP response 200
assertEquals(
"Bad HTTP status received",
200,
conn.getResponseCode()
);
Assertions.assertEquals(200, conn.getResponseCode(), "Bad HTTP status received");
// Verifies the Content-Type header
assertEquals(
"Response content type is not TEXT PLAIN or UTF-8",
Assertions.assertEquals(
"text/plain;charset=utf-8",
conn.getContentType().toLowerCase()
conn.getContentType().toLowerCase(),
"Response content type is not TEXT PLAIN or UTF-8"
);
// Get the content and verify its size
final String diagram = getContentText(conn.getInputStream());
assertEquals(TestUtils.SEQBOB, diagram);
Assertions.assertEquals(TestUtils.SEQBOB, diagram);
}
}