HTTPCLIENT-1690: Updated a test case

This commit is contained in:
Sudheera Palihakkara 2018-01-15 18:31:00 +08:00
parent f1f3a38763
commit 0593c591ad
1 changed files with 10 additions and 0 deletions

View File

@ -257,6 +257,7 @@ public class TestCacheEntryUpdater {
final Header[] updatedHeaders = updatedEntry.getAllHeaders();
headersContain(updatedHeaders, "Content-Encoding", "identity");
headersNotContain(updatedHeaders, "Content-Encoding", "gzip");
}
private void headersContain(final Header[] headers, final String name, final String value) {
@ -270,4 +271,13 @@ public class TestCacheEntryUpdater {
fail("Header [" + name + ": " + value + "] not found in headers.");
}
private void headersNotContain(final Header[] headers, final String name, final String value) {
for (final Header header : headers) {
if (header.getName().equals(name)) {
if (header.getValue().equals(value)) {
fail("Header [" + name + ": " + value + "] found in headers where it should not be");
}
}
}
}
}