JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-6170

HttpResponseBuilderTestCase.validateHeader() is incorrect which masks broken tests

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.3 RC4
  • Fix Version/s: 3.3.0, 3.4.0
  • Component/s: Transport: HTTP(S) / Jetty
  • Labels:
    None
  • User impact:
    Very Low
  • Similar Issues:
    None

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));
    }

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Evangelina Martinez Ruiz Moreno made changes - 17/Apr/12 04:48 PM
Field Original Value New Value
Assignee Evangelina Martinez Ruiz Moreno [ evangelinamrm ]
Evangelina Martinez Ruiz Moreno made changes - 17/Apr/12 04:48 PM
Priority To be reviewed [ 6 ] Critical [ 2 ]
Evangelina Martinez Ruiz Moreno made changes - 17/Apr/12 04:48 PM
Status Open [ 1 ] In Progress [ 3 ]
Alejandro Sequeira made changes - 13/Jun/12 02:31 PM
Affects Version/s 3.3.0 [ 11110 ]
Affects Version/s 3.3 RC4 [ 11276 ]
Evangelina Martinez Ruiz Moreno made changes - 13/Jun/12 02:39 PM
Resolution Fixed [ 1 ]
Fix Version/s 3.4.0 [ 11142 ]
Fix Version/s 3.3.0 [ 11110 ]
Status In Progress [ 3 ] Closed [ 6 ]

People

  • Assignee:
    Evangelina Martinez Ruiz Moreno
    Reporter:
    David Dossot
Vote (0)
Watch (0)

Dates

  • Created:
    17/Apr/12 04:30 PM
    Updated:
    13/Jun/12 02:39 PM
    Resolved:
    13/Jun/12 02:39 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.