Skip to content

Commit

Permalink
Fix to properly follow redirect URI in testPostDataFormAuth
Browse files Browse the repository at this point in the history
The test was passing even though it should failed, fixed now.
  • Loading branch information
Radim Hatlapatka committed Jul 14, 2014
1 parent cf4e5ef commit 52c281d
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
*/
package org.jboss.as.test.integration.web.formauth;

import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
Expand Down Expand Up @@ -56,6 +50,12 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
Expand Down Expand Up @@ -242,7 +242,7 @@ public void testFormAuthSubject() throws Exception {

/**
* Test that a post from an unsecured form to a secured servlet does not
* loose its data during the redirct to the form login.
* loose its data during the redirect to the form login.
*/
@Test
@OperateOnDeployment("form-auth.war")
Expand Down Expand Up @@ -312,7 +312,7 @@ public void testPostDataFormAuth() throws Exception {
// Follow the redirect to the SecureServlet
Header location = postResponse.getFirstHeader("Location");
URL indexURI = new URL(location.getValue());
HttpGet war1Index = new HttpGet(url.toURI());
HttpGet war1Index = new HttpGet(indexURI.toURI());

log.info("Executing request " + war1Index.getRequestLine());
HttpResponse war1Response = httpclient.execute(war1Index);
Expand Down

0 comments on commit 52c281d

Please sign in to comment.