Uploaded image for project: 'Mule'
  1. Mule
  2. MULE-6170

HttpResponseBuilderTestCase.validateHeader() is incorrect which masks broken tests

    Details

    • User impact:
      Very Low
    • Similar Issues:

      Description

      validateHeader returns happily if the expected header is not present, which allows otherwise broken tests to pass.

      I suggest to add a fail() statement at the end to solve this:

          private void validateHeader(final Header[] headers, final String headerName, final String expectedValue)
          {
              for (final Header header : headers)
              {
                  if (headerName.equals(header.getName()))
                  {
                      assertEquals(expectedValue, header.getValue());
                      return;
                  }
              }
      
              fail(String.format("Didn't find header: %s=%s in headers: %s", headerName, expectedValue, headers));
          }
      

        Attachments

          Activity

            People

            • Assignee:
              evangelinamrm Evangelina Martinez Ruiz Moreno
              Reporter:
              ddossot David Dossot
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                30/Apr/12