Class XSSFilterTest

java.lang.Object
de.hybris.platform.servicelayer.web.XSSFilterTest

@UnitTest public class XSSFilterTest extends Object
  • Constructor Details

    • XSSFilterTest

      public XSSFilterTest()
  • Method Details

    • testSetup

      public void testSetup() throws Exception
      Throws:
      Exception
    • createSampleHeaders

      protected Map<String,String> createSampleHeaders()
    • createDefaultRulePatternDefinitions

      protected Map<String,String> createDefaultRulePatternDefinitions()
    • createOrderedRulePatternDefinitions

      protected Map<String,String> createOrderedRulePatternDefinitions()
    • testLegalParamsForStrippingFilter

      public void testLegalParamsForStrippingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testStrippingFilterOrdered

      public void testStrippingFilterOrdered() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testLegalParamsForRejectingFilter

      public void testLegalParamsForRejectingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testLegalParams

      protected void testLegalParams(XSSFilter filter) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testIllegalParamsForStrippingFilter

      public void testIllegalParamsForStrippingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testIllegalParamsForRejectingFilter

      public void testIllegalParamsForRejectingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testLegalHeadersForStrippingFilter

      public void testLegalHeadersForStrippingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testLegalHeadersForRejectingFilter

      public void testLegalHeadersForRejectingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testIllegalHeadersForStripingFilter

      public void testIllegalHeadersForStripingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testIllegalHeadersForStripingFilter

      protected void testIllegalHeadersForStripingFilter(XSSFilter strippingFilter) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testIllegalHeadersForRejectingFilter

      public void testIllegalHeadersForRejectingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testCachingForStrippingFilter

      public void testCachingForStrippingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testCachingForrejectingFilter

      public void testCachingForrejectingFilter() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testHeadersInjectedProperly

      public void testHeadersInjectedProperly() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • testHeadersInjectedProperlyAndPatternsStripped

      public void testHeadersInjectedProperlyAndPatternsStripped() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • shouldAllowHostIfHeaderWhiteListIsNull

      public void shouldAllowHostIfHeaderWhiteListIsNull() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • shouldAllowHostIfHeaderWhiteListIsEmpty

      public void shouldAllowHostIfHeaderWhiteListIsEmpty() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • shouldAllowHostIfHeaderWhiteListMatches

      public void shouldAllowHostIfHeaderWhiteListMatches() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • shouldRejectHostIfHeaderWhiteListDoesNotMatch

      public void shouldRejectHostIfHeaderWhiteListDoesNotMatch() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • shouldAcceptHostIfHeaderWhiteListMatchesOneOfMany

      public void shouldAcceptHostIfHeaderWhiteListMatchesOneOfMany() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • shouldRejectHostIfHeaderMatchesNoEntry

      public void shouldRejectHostIfHeaderMatchesNoEntry() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • shouldAcceptRegexpAsWhiteListRule

      public void shouldAcceptRegexpAsWhiteListRule() throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException