MCPcopy Index your code
hub / github.com/OpenFeign/feign / caseInsensitiveCopyOfMap

Method caseInsensitiveCopyOfMap

core/src/test/java/feign/UtilTest.java:261–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259 }
260
261 @Test
262 void caseInsensitiveCopyOfMap() {
263 // Arrange
264 Map<String, Collection<String>> sourceMap = new HashMap<>();
265
266 sourceMap.put("First", Arrays.asList("abc", "qwerty", "xyz"));
267 sourceMap.put("camelCase", Collections.singleton("123"));
268 // Act
269 Map<String, Collection<String>> actualMap = caseInsensitiveCopyOf(sourceMap);
270 // Assert result
271 assertThat(actualMap)
272 .hasEntrySatisfying(
273 "First",
274 value -> {
275 assertThat(value).contains("xyz", "abc", "qwerty");
276 })
277 .hasEntrySatisfying(
278 "first",
279 value -> {
280 assertThat(value).contains("xyz", "abc", "qwerty");
281 })
282 .hasEntrySatisfying(
283 "CAMELCASE",
284 value -> {
285 assertThat(value).contains("123");
286 })
287 .hasEntrySatisfying(
288 "camelcase",
289 value -> {
290 assertThat(value).contains("123");
291 });
292 }
293
294 @Test
295 void copyIsUnmodifiable() {

Callers

nothing calls this directly

Calls 4

caseInsensitiveCopyOfMethod · 0.80
putMethod · 0.65
asListMethod · 0.45
assertThatMethod · 0.45

Tested by

no test coverage detected