diff --git a/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/ErrorRoutingIT.java b/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/ErrorRoutingIT.java index d687599fb2f..3b55d065033 100644 --- a/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/ErrorRoutingIT.java +++ b/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/ErrorRoutingIT.java @@ -69,9 +69,10 @@ public void testRequestRejectedExceptionErrorPage() throws IOException { private String CallErrorPageAndCheckHttpStatusCode(String errorPath, String method, int codeExpected) throws IOException { HttpURLConnection cn = (HttpURLConnection)new URL(baseUrl + errorPath).openConnection(); cn.setRequestMethod(method); + cn.setRequestProperty("Accept", "text/html"); // connection initiate cn.connect(); - Assert.assertEquals("Check status code from " + errorPath + " is " + codeExpected, cn.getResponseCode(), codeExpected); + Assert.assertEquals("Check status code from " + errorPath + " is " + codeExpected, codeExpected, cn.getResponseCode()); return getResponseBody(cn); }