Skip to content

Commit 91c3120

Browse files
committed
Fixed UnconfiguredBehaviorTest to work correctly on Wildfly
1 parent 2d6a218 commit 91c3120

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎impl-servlet-tests/src/test/java/org/ocpsoft/rewrite/servlet/config/UnconfiguredBehaviorTest.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
*/
1616
package org.ocpsoft.rewrite.servlet.config;
1717

18-
import junit.framework.Assert;
18+
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.assertThat;
1920

2021
import org.apache.http.client.methods.HttpGet;
22+
import org.hamcrest.Matchers;
2123
import org.jboss.arquillian.container.test.api.Deployment;
2224
import org.jboss.arquillian.junit.Arquillian;
2325
import org.jboss.shrinkwrap.api.spec.WebArchive;
@@ -45,7 +47,9 @@ public static WebArchive getDeployment()
4547
public void testErrorPageIsDisplayed() throws Exception
4648
{
4749
HttpAction<HttpGet> action = get("/other");
48-
Assert.assertEquals(404, action.getResponse().getStatusLine().getStatusCode());
49-
Assert.assertTrue(action.getResponseContent().contains("404"));
50+
assertEquals(404, action.getResponse().getStatusLine().getStatusCode());
51+
assertThat(action.getResponseContent(), Matchers.anyOf(
52+
Matchers.containsString("404"), // most containers
53+
Matchers.containsString("Not Found"))); // Wildfly
5054
}
5155
}

0 commit comments

Comments
 (0)