Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4558

WicketTester fails with a StringIndexOutOfBounds exception when using an external redirect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5.6
    • 1.5.7, 6.0.0-beta3
    • wicket
    • None

    Description

      When testing a component that e.g. throws a RedirectToUrlException("http://foo/") WicketTester fails with a StringIndexOutOfBoundsException in ServletWebRequest#getContextRelativeUrl. I'm aware that WT doesn't currently support this and needs setFollowRedirects(false) in this case, but there should be a more meaningful error message than this.

      I'll attempt to distinguish local redirects from external ones and providing the external URL in a new assertExternalRedirectUrl method instead of having it crash and burn.

      Attachments

        Activity

          People

            cmenzel Carl-Eric Menzel
            cmenzel Carl-Eric Menzel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: