From 0593c591adc9e3854874899fc4edb03808d372c5 Mon Sep 17 00:00:00 2001 From: Sudheera Palihakkara Date: Mon, 15 Jan 2018 18:31:00 +0800 Subject: [PATCH] HTTPCLIENT-1690: Updated a test case --- .../http/impl/client/cache/TestCacheEntryUpdater.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheEntryUpdater.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheEntryUpdater.java index ed02ce582..a0a873742 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheEntryUpdater.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheEntryUpdater.java @@ -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"); + } + } + } + } }