Use Map#forEach instead of Map#entrySet#forEach
See gh-1449
This commit is contained in:
@@ -281,8 +281,8 @@ public class BaseViewTests {
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void checkContainsAll(Map expected, Map<String, Object> actual) {
|
||||
expected.keySet().stream().forEach(
|
||||
key -> assertEquals("Values for model key '" + key + "' must match", expected.get(key), actual.get(key))
|
||||
expected.forEach(
|
||||
(k, v) -> assertEquals("Values for model key '" + k + "' must match", expected.get(k), actual.get(k))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,8 +84,9 @@ public class InternalResourceViewTests {
|
||||
view.render(model, request, response);
|
||||
assertEquals(url, response.getForwardedUrl());
|
||||
|
||||
model.keySet().stream().forEach(
|
||||
key -> assertEquals("Values for model key '" + key + "' must match", model.get(key), request.getAttribute(key))
|
||||
|
||||
model.forEach(
|
||||
(key, value) -> assertEquals("Values for model key '" + key + "' must match", value, request.getAttribute(key))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -101,7 +102,7 @@ public class InternalResourceViewTests {
|
||||
view.render(model, request, response);
|
||||
assertEquals(url, response.getIncludedUrl());
|
||||
|
||||
model.keySet().stream().forEach(key -> verify(request).setAttribute(key, model.get(key)));
|
||||
model.forEach((key, value) -> verify(request).setAttribute(key, value));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -116,7 +117,7 @@ public class InternalResourceViewTests {
|
||||
view.render(model, request, response);
|
||||
assertEquals(url, response.getIncludedUrl());
|
||||
|
||||
model.keySet().stream().forEach(key -> verify(request).setAttribute(key, model.get(key)));
|
||||
model.forEach((key, value) -> verify(request).setAttribute(key, value));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -132,7 +133,7 @@ public class InternalResourceViewTests {
|
||||
view.render(model, request, response);
|
||||
assertEquals(url, response.getIncludedUrl());
|
||||
|
||||
model.keySet().stream().forEach(key -> verify(request).setAttribute(key, model.get(key)));
|
||||
model.forEach((k, v) -> verify(request).setAttribute(k, v));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user