http-request-061 (AB)

Tests that document property headers are only used if the headers option doesn’t specify a header with the same name.

Test ab-http-request-061.xml is expected to pass.

The pipeline

      <p:declare-step xmlns:p="" version="3.0">
         <p:output port="result"/>

         <p:http-request name="one" href="" method="post" headers="map{'header' : 'value1'}">
             <p:inline><doc xmlns=""/></p:inline>

         <p:http-request name="two" href="" method="post">
             <p:inline document-properties="map{'chttp:HEADER' : 'value2'}"><doc xmlns=""/></p:inline>

         <p:http-request name="three" href="" method="post" headers="map{'header' : 'value1'}">
             <p:inline document-properties="map{'chttp:HEADER' : 'value2'}"><doc xmlns=""/></p:inline>

         <p:wrap-sequence wrapper="headers">
           <p:with-input port="source" pipe="@one @two @three"/>

MorganaXProc passing XML Calabash passing

Schematron validation

      <s:schema xmlns:s="">
            <s:rule context="/">
               <s:assert test="headers">The root element is not 'doc'.</s:assert>
            <s:rule context="/headers">
               <s:assert test="count(headers)=3">Wrong number of responses.</s:assert>
               <s:assert test="headers[1]/header[@name='HEADER']/@value = 'value1'">First request gets incorrect header value.</s:assert>
               <s:assert test="headers[2]/header[@name='HEADER']/@value = 'value2'">Second request gets incorrect header value.</s:assert>
               <s:assert test="headers[3]/header[@name='HEADER']/@value = 'value1'">Third request gets incorrect header value.</s:assert>

Revision history

18 Mar 2020, Norman Tovey-Walsh

Changed the header to be in the correct namespace. Changed the test so that it passes as the spec now explicitly states that the comparisons must be performed in a case-insensitive manner.

14 Jan 2020, Achim Berndzen

Added new tests for p:http-request.