Fix LinkedCaseInsensitiveMap collection methods
Ensure that results returned from keySet, entrySet & values are tracked to remove case insensitive keys from the source map. Closes gh-22821
This commit is contained in:
committed by
Sam Brannen
parent
a871f609ea
commit
aa69703f3b
@@ -36,7 +36,6 @@ import java.util.Map.Entry;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
@@ -561,7 +560,6 @@ public class HttpHeadersTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Disabled until gh-22821 is resolved")
|
||||
public void removalFromKeySetRemovesEntryFromUnderlyingMap() {
|
||||
String headerName = "MyHeader";
|
||||
String headerValue = "value";
|
||||
@@ -572,11 +570,10 @@ public class HttpHeadersTests {
|
||||
headers.keySet().removeIf(key -> key.equals(headerName));
|
||||
assertTrue(headers.isEmpty());
|
||||
headers.add(headerName, headerValue);
|
||||
assertEquals(headerValue, headers.get(headerName));
|
||||
assertEquals(headerValue, headers.get(headerName).get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Disabled until gh-22821 is resolved")
|
||||
public void removalFromEntrySetRemovesEntryFromUnderlyingMap() {
|
||||
String headerName = "MyHeader";
|
||||
String headerValue = "value";
|
||||
@@ -587,7 +584,7 @@ public class HttpHeadersTests {
|
||||
headers.entrySet().removeIf(entry -> entry.getKey().equals(headerName));
|
||||
assertTrue(headers.isEmpty());
|
||||
headers.add(headerName, headerValue);
|
||||
assertEquals(headerValue, headers.get(headerName));
|
||||
assertEquals(headerValue, headers.get(headerName).get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user