You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2022/09/08 13:15:21 UTC

[sling-org-apache-sling-commons-crypto] branch master updated: SLING-11570 Adjust integration tests to not fail due to incompatible change in Jetty's status message handling

This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-crypto.git


The following commit(s) were added to refs/heads/master by this push:
     new 17e7a4e  SLING-11570 Adjust integration tests to not fail due to incompatible change in Jetty's status message handling
17e7a4e is described below

commit 17e7a4efbebd3eb04d47f356d5a6d68043287422
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Sep 8 15:14:53 2022 +0200

    SLING-11570 Adjust integration tests to not fail due to incompatible change in Jetty's status message handling
    
    test document title instead of response status message
---
 .../sling/commons/crypto/it/tests/CryptoTestSupport.java    |  2 --
 .../commons/crypto/it/tests/EncryptWebConsolePluginIT.java  | 13 ++++++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/sling/commons/crypto/it/tests/CryptoTestSupport.java b/src/test/java/org/apache/sling/commons/crypto/it/tests/CryptoTestSupport.java
index cdfc3f5..a6c5a3a 100644
--- a/src/test/java/org/apache/sling/commons/crypto/it/tests/CryptoTestSupport.java
+++ b/src/test/java/org/apache/sling/commons/crypto/it/tests/CryptoTestSupport.java
@@ -18,7 +18,6 @@
  */
 package org.apache.sling.commons.crypto.it.tests;
 
-import org.apache.sling.testing.paxexam.SlingOptions;
 import org.apache.sling.testing.paxexam.TestSupport;
 import org.ops4j.pax.exam.options.ModifiableCompositeOption;
 
@@ -28,7 +27,6 @@ import static org.ops4j.pax.exam.CoreOptions.composite;
 public abstract class CryptoTestSupport extends TestSupport {
 
     public ModifiableCompositeOption baseConfiguration() {
-        SlingOptions.versionResolver.setVersion("org.apache.felix", "org.apache.felix.http.jetty", "4.0.14"); // 4.0.16 is incompatible due to change in Jetty 9.4.21
         return composite(
             super.baseConfiguration(),
             // Sling Commons Crypto
diff --git a/src/test/java/org/apache/sling/commons/crypto/it/tests/EncryptWebConsolePluginIT.java b/src/test/java/org/apache/sling/commons/crypto/it/tests/EncryptWebConsolePluginIT.java
index 9737192..2220712 100644
--- a/src/test/java/org/apache/sling/commons/crypto/it/tests/EncryptWebConsolePluginIT.java
+++ b/src/test/java/org/apache/sling/commons/crypto/it/tests/EncryptWebConsolePluginIT.java
@@ -46,6 +46,7 @@ import org.osgi.framework.ServiceRegistration;
 
 import static org.apache.sling.testing.paxexam.SlingOptions.webconsole;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.endsWith;
 import static org.hamcrest.Matchers.is;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
@@ -145,7 +146,9 @@ public class EncryptWebConsolePluginIT extends CryptoTestSupport {
             .ignoreHttpErrors(true)
             .execute();
         assertThat(response.statusCode(), is(400));
-        assertThat(response.statusMessage(), is("Parameter message is missing"));
+
+        final Document document = response.parse();
+        assertThat(document.title(), endsWith("Parameter message is missing"));
     }
 
     @Test
@@ -158,7 +161,9 @@ public class EncryptWebConsolePluginIT extends CryptoTestSupport {
             .ignoreHttpErrors(true)
             .execute();
         assertThat(response.statusCode(), is(400));
-        assertThat(response.statusMessage(), is("Parameter service-id is missing"));
+
+        final Document document = response.parse();
+        assertThat(document.title(), endsWith("Parameter service-id is missing"));
     }
 
     @Test
@@ -173,7 +178,9 @@ public class EncryptWebConsolePluginIT extends CryptoTestSupport {
             .ignoreHttpErrors(true)
             .execute();
         assertThat(response.statusCode(), is(404));
-        assertThat(response.statusMessage(), is("Crypto service with service id invalid not found"));
+
+        final Document document = response.parse();
+        assertThat(document.title(), endsWith("Crypto service with service id invalid not found"));
     }
 
 }