Polish "Use Map#forEach instead of Map#entrySet#forEach"

Closes gh-1449
This commit is contained in:
Stephane Nicoll
2017-06-12 14:28:24 +02:00
parent 2efa06237a
commit 451b419624
5 changed files with 13 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -281,9 +281,8 @@ public class BaseViewTests {
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private void checkContainsAll(Map expected, Map<String, Object> actual) {
expected.forEach(
(k, v) -> assertEquals("Values for model key '" + k + "' must match", expected.get(k), actual.get(k))
);
expected.forEach((k, v) -> assertEquals("Values for model key '" + k
+ "' must match", expected.get(k), actual.get(k)));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -84,10 +84,8 @@ public class InternalResourceViewTests {
view.render(model, request, response);
assertEquals(url, response.getForwardedUrl());
model.forEach(
(key, value) -> assertEquals("Values for model key '" + key + "' must match", value, request.getAttribute(key))
);
model.forEach((key, value) -> assertEquals("Values for model key '" + key
+ "' must match", value, request.getAttribute(key)));
}
@Test