From 5dcb38d48430dd33cd412ac92361f24011fee23c Mon Sep 17 00:00:00 2001 From: melloware Date: Wed, 16 Aug 2023 08:00:59 -0400 Subject: [PATCH] Fix #481: Integration Test URLEncode UI resources --- .../src/main/ui-angular/src/image with spaces.svg | 1 + .../quinoa/it/QuinoaUIAngularTest.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 integration-tests/src/main/ui-angular/src/image with spaces.svg diff --git a/integration-tests/src/main/ui-angular/src/image with spaces.svg b/integration-tests/src/main/ui-angular/src/image with spaces.svg new file mode 100644 index 00000000..41d044ac --- /dev/null +++ b/integration-tests/src/main/ui-angular/src/image with spaces.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/integration-tests/src/test/java/io/quarkiverse/quinoa/it/QuinoaUIAngularTest.java b/integration-tests/src/test/java/io/quarkiverse/quinoa/it/QuinoaUIAngularTest.java index 4cd88006..bbad77c6 100644 --- a/integration-tests/src/test/java/io/quarkiverse/quinoa/it/QuinoaUIAngularTest.java +++ b/integration-tests/src/test/java/io/quarkiverse/quinoa/it/QuinoaUIAngularTest.java @@ -39,6 +39,9 @@ public class QuinoaUIAngularTest { @TestHTTPResource("/bar/foo/api/quinoa") URL api; + @TestHTTPResource("/image with spaces.svg") + URL imageWithSpaces; + @Test public void testUIIndex() { checkUrl(index); @@ -64,6 +67,18 @@ private void checkUrl(URL url) { Assertions.assertEquals("Hello Quinoa", greeting); } + /** + * Test an image with spaces "a b.png" get encoded "a%20b.png". + * + * @see GitHub Issue 481 + */ + @Test + public void testUIEncodedPath() { + final Page page = context.newPage(); + Response response = page.navigate(imageWithSpaces.toString()); + Assertions.assertEquals("OK", response.statusText()); + } + @Test public void test404Endpoint() { given()