Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 3.3 RC4
-
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)); }