Skip to content

Commit b223487

Browse files
committed
jdk17
1 parent 77885e1 commit b223487

File tree

5 files changed

+10
-21
lines changed

5 files changed

+10
-21
lines changed

src/test/java/org/htmlunit/CookieManager2Test.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public void cookie_nullValue() throws Exception {
9292
final WebClient webClient = getWebClient();
9393
final MockWebConnection webConnection = new MockWebConnection();
9494

95-
final URL url = URL_FIRST;
96-
webConnection.setResponse(url, CookieManagerTest.HTML_ALERT_COOKIE);
95+
webConnection.setResponse(URL_FIRST, CookieManagerTest.HTML_ALERT_COOKIE);
9796
webClient.setWebConnection(webConnection);
9897

9998
final CookieManager mgr = webClient.getCookieManager();
@@ -115,8 +114,7 @@ public void cookie_maxAgeMinusOne() throws Exception {
115114
final WebClient webClient = getWebClient();
116115
final MockWebConnection webConnection = new MockWebConnection();
117116

118-
final URL url = URL_FIRST;
119-
webConnection.setResponse(url, CookieManagerTest.HTML_ALERT_COOKIE);
117+
webConnection.setResponse(URL_FIRST, CookieManagerTest.HTML_ALERT_COOKIE);
120118
webClient.setWebConnection(webConnection);
121119

122120
final CookieManager mgr = webClient.getCookieManager();

src/test/java/org/htmlunit/WebClientTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -884,9 +884,7 @@ public void redirectViaJavaScriptDuringInitialPageLoad() throws Exception {
884884

885885
webClient.setWebConnection(webConnection);
886886

887-
final URL url = URL_FIRST;
888-
889-
final HtmlPage page = webClient.getPage(url);
887+
final HtmlPage page = webClient.getPage(URL_FIRST);
890888
assertEquals("Second", page.getTitleText());
891889
}
892890

@@ -1295,9 +1293,8 @@ private File getTestFile(final String fileName) throws Exception {
12951293
if (url == null) {
12961294
throw new FileNotFoundException(fileName);
12971295
}
1298-
final File file = new File(new URI(url.toString()));
12991296

1300-
return file;
1297+
return new File(new URI(url.toString()));
13011298
}
13021299

13031300
/**

src/test/java/org/htmlunit/doc/StorageHolderTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public void sessionStorage() throws Exception {
3939
conn.setDefaultResponse("<script>sessionStorage.setItem('myNewKey', 'myNewData');</script>");
4040

4141
startWebServer(conn);
42-
final URL url = URL_FIRST;
4342

4443
try (WebClient webClient = new WebClient()) {
4544

@@ -51,7 +50,7 @@ public void sessionStorage() throws Exception {
5150
sessionStorage.put("myKey", "myData");
5251

5352
// load the page that consumes the session storage data
54-
webClient.getPage(url);
53+
webClient.getPage(URL_FIRST);
5554

5655
// make sure the new data are in
5756
assertEquals("myNewData", sessionStorage.get("myNewKey"));

src/test/java/org/htmlunit/html/HtmlFileInput2Test.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ private static HttpEntity post(final WebClient client,
355355
final HttpClientBuilder builder = (HttpClientBuilder) getHttpClientBuilderMethod.invoke(con);
356356

357357
final HttpPost httpPost = (HttpPost) makeHttpMethod.invoke(con, webConnection.getLastWebRequest(), builder);
358-
final HttpEntity httpEntity = httpPost.getEntity();
359-
return httpEntity;
358+
return httpPost.getEntity();
360359
}
361360

362361
/**

src/test/java/org/htmlunit/javascript/host/WindowTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -836,8 +836,7 @@ public void status() throws Exception {
836836
+ "</script></head><body onload='doTest()'>\n"
837837
+ "</body></html>";
838838

839-
final URL url = URL_FIRST;
840-
webConnection.setResponse(url, firstContent);
839+
webConnection.setResponse(URL_FIRST, firstContent);
841840
webClient.setWebConnection(webConnection);
842841

843842
final List<String> collectedAlerts = new ArrayList<>();
@@ -1554,8 +1553,7 @@ public void printHandler() throws Exception {
15541553
+ " <button id='click' onclick='doTest()'>Print</button>\n"
15551554
+ "</body></html>";
15561555

1557-
final URL url = URL_FIRST;
1558-
webConnection.setResponse(url, firstContent);
1556+
webConnection.setResponse(URL_FIRST, firstContent);
15591557
webClient.setWebConnection(webConnection);
15601558

15611559
HtmlPage page = webClient.getPage(URL_FIRST);
@@ -1673,8 +1671,7 @@ public void printEvent() throws Exception {
16731671
+ " <button id='click' onclick='doTest()'>Print</button>\n"
16741672
+ "</body></html>";
16751673

1676-
final URL url = URL_FIRST;
1677-
webConnection.setResponse(url, firstContent);
1674+
webConnection.setResponse(URL_FIRST, firstContent);
16781675
webClient.setWebConnection(webConnection);
16791676

16801677
final HtmlPage page = webClient.getPage(URL_FIRST);
@@ -1723,8 +1720,7 @@ public void printCssMediaRule() throws Exception {
17231720
+ " <button id='click' onclick='doTest()'>Print</button>\n"
17241721
+ "</body></html>";
17251722

1726-
final URL url = URL_FIRST;
1727-
webConnection.setResponse(url, firstContent);
1723+
webConnection.setResponse(URL_FIRST, firstContent);
17281724
webClient.setWebConnection(webConnection);
17291725

17301726
final HtmlPage page = webClient.getPage(URL_FIRST);

0 commit comments

Comments
 (0)