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

Method copyIsUnmodifiable

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

Source from the content-addressed store, hash-verified

292 }
293
294 @Test
295 void copyIsUnmodifiable() {
296 // Arrange
297 Map<String, Collection<String>> sourceMap = new HashMap<>();
298
299 sourceMap.put("First", Arrays.asList("abc", "qwerty", "xyz"));
300 sourceMap.put("camelCase", Collections.singleton("123"));
301 // Act
302 Map<String, Collection<String>> unmodifiableMap = caseInsensitiveCopyOf(sourceMap);
303 // Assert result
304 assertThatThrownBy(() -> unmodifiableMap.put("new", Collections.singleton("223322")))
305 .isInstanceOf(UnsupportedOperationException.class);
306 assertThatThrownBy(() -> unmodifiableMap.get("camelCase").clear())
307 .isInstanceOf(UnsupportedOperationException.class);
308 }
309
310 @Test
311 void nullMap() {

Callers

nothing calls this directly

Calls 4

caseInsensitiveCopyOfMethod · 0.80
putMethod · 0.65
getMethod · 0.65
asListMethod · 0.45

Tested by

no test coverage detected