Polish "Call the value adapter during NamedContributorsMapAdapter construction"

See gh-31676
This commit is contained in:
Phillip Webb
2022-07-26 18:12:08 +01:00
parent c530f12cc3
commit 59c9a9cd8a
2 changed files with 14 additions and 22 deletions

View File

@@ -32,6 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
* Tests for {@link NamedContributorsMapAdapter}.
*
* @author Phillip Webb
* @author Guirong Hu
*/
class NamedContributorsMapAdapterTests {
@@ -94,12 +95,11 @@ class NamedContributorsMapAdapterTests {
}
@Test
void eachValueAdapterShouldBeCalledOnlyOnce() {
void getContributorCallsAdaptersOnlyOnce() {
Map<String, String> map = new LinkedHashMap<>();
map.put("one", "one");
map.put("two", "two");
int callCount = map.size();
AtomicInteger counter = new AtomicInteger(0);
TestNamedContributorsMapAdapter<String> adapter = new TestNamedContributorsMapAdapter<>(map,
(name) -> count(name, counter));