Replace assertThat(x.iterator().next()) with assertThat(x).element(0)

Search for   : assertThat\((.+).iterator\(\).next\(\)\)
Replace with : assertThat($1).element(0)
This commit is contained in:
Yanming Zhou
2023-12-06 10:36:28 +08:00
parent 3f9a809c32
commit 785ad399e9
28 changed files with 67 additions and 67 deletions

View File

@@ -265,7 +265,7 @@ class MockHttpServletResponseTests {
Collection<String> responseHeaders = response.getHeaderNames();
assertThat(responseHeaders).isNotNull();
assertThat(responseHeaders).hasSize(1);
assertThat(responseHeaders.iterator().next()).as("HTTP header casing not being preserved").isEqualTo(headerName);
assertThat(responseHeaders).element(0).as("HTTP header casing not being preserved").isEqualTo(headerName);
}
@Test