Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10868

Search pattern in getSlingLocation method only works if id is the last attribute

    XMLWordPrintableJSON

Details

    • Important

    Description

      The method getSlingLocation in class SlingHttpResponse uses a search pattern which only works if the "id" attribute is the last one. We have implemented a link rewriter transformer in our project which adds a class="internal" to each internal link. In our case now the class attribute is the last one and the method  extractFromHTMLResponse(String searchPattern) will return null because it won't find the the searched string in the content (see attached response_content.txt).

       

      https://github.com/apache/sling-org-apache-sling-testing-clients/blob/c8a6d4bd9c3e92a2c00920d86f3d27d58478050e/src/main/java/org/apache/sling/testing/clients/SlingHttpResponse.java#L201

       

      The same issue exists for other methods like 

      - getSlingParentLocation()

      - getSlingReferer()

       

      It seems AEMaaCs uses the aem-test-samples (https://github.com/adobe/aem-test-samples) for integration tests during the production pipeline run. One of the tests is using the getSlingLocation method which causes termination of the deployment process.

       

      https://github.com/adobe/aem-test-samples/blob/4f7653db344c3f31f4a1a6440bf0f01db75ea382/smoke/src/main/java/com/adobe/cq/cloud/testing/it/smoke/CreatePageAsAuthorUserIT.java#L78

       

      Attachments

        1. response_content.txt
          2 kB
          Michael Kitanovski

        Activity

          People

            andrei.dulvac Andrei Dulvac
            mkitanovski Michael Kitanovski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: