Skip to content

Commit

Permalink
fix: update test to conform errorHandlingMethod=remote config #4815 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 authored May 5, 2023
1 parent ed48b4f commit cf0cca4
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;

import java.util.Collections;
import java.net.URL;

import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
Expand All @@ -16,12 +17,17 @@ public class UidOnlyAuthTest extends BaseTest {
private static final String QNAME = "io.jans.agama.test.auth.uidOnly";

@Test
public void randUid() {
@Parameters("redirectUri")
public void randUid(String redirectUri) {

HtmlPage page = (HtmlPage) start("" + Math.random());
Page page = start("" + Math.random());
assertOK(page);
assertTrue(page.getUrl().toString().endsWith("error.htm"));
assertTextContained(page.getVisibleText().toLowerCase(), "failed", "authenticate");

URL url = page.getUrl();
//It is assumed errorHandlingMethod=remote in auth-server config, thus
//the RP handles the error - the built-in AS error page is not shown
assertTrue(url.toString().startsWith(redirectUri));
assertTrue(url.getQuery().toString().contains("error="));

}

Expand Down

0 comments on commit cf0cca4

Please sign in to comment.