Skip to content

Commit 3af3f5e

Browse files
author
Kirill Peshin
committed
update
1 parent 1ce669c commit 3af3f5e

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/main/java/com/github/tomakehurst/wiremock/common/xml/XmlNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private static Map<String, String> convertAttributeMap(NamedNodeMap namedNodeMap
107107
map.put(node.getNodeName(), node.getNodeValue());
108108
}
109109

110-
return map;
110+
return Collections.unmodifiableMap(map);
111111
}
112112

113113
public Map<String, String> getAttributes() {

src/main/java/com/github/tomakehurst/wiremock/extension/Extensions.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,14 @@ public static Extension load(Class<? extends Extension> extensionClass) {
186186
@SuppressWarnings("unchecked")
187187
public <T extends Extension> Map<String, T> ofType(Class<T> extensionType) {
188188
return (Map<String, T>)
189-
loadedExtensions.entrySet().stream()
190-
.filter(valueAssignableFrom(extensionType))
191-
.collect(
192-
Collectors.toMap(
193-
Map.Entry::getKey,
194-
Map.Entry::getValue,
195-
(entry1, entry2) -> entry1,
196-
LinkedHashMap::new));
189+
Collections.unmodifiableMap(
190+
loadedExtensions.entrySet().stream()
191+
.filter(valueAssignableFrom(extensionType))
192+
.collect(
193+
Collectors.toMap(
194+
Map.Entry::getKey,
195+
Map.Entry::getValue,
196+
(entry1, entry2) -> entry1,
197+
LinkedHashMap::new)));
197198
}
198199
}

src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/RequestWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public Map<String, Cookie> getCookies() {
193193

194194
cookieMap.putAll(additionalCookies);
195195

196-
return cookieMap;
196+
return Collections.unmodifiableMap(cookieMap);
197197
}
198198

199199
@Override

0 commit comments

Comments
 (0)