Skip to content

Commit acb2aec

Browse files
committed
Compatibility with HtmlUnit 2.51
Includes upgrade to Tomcat 9.0.50, Jetty 9.4.43, Jackson 2.12.4. Closes gh-27147
1 parent 297880d commit acb2aec

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ configure(allprojects) { project ->
2727

2828
dependencyManagement {
2929
imports {
30-
mavenBom "com.fasterxml.jackson:jackson-bom:2.12.3"
30+
mavenBom "com.fasterxml.jackson:jackson-bom:2.12.4"
3131
mavenBom "io.netty:netty-bom:4.1.65.Final"
3232
mavenBom "io.projectreactor:reactor-bom:2020.0.8"
3333
mavenBom "io.r2dbc:r2dbc-bom:Arabba-SR10"
3434
mavenBom "io.rsocket:rsocket-bom:1.1.1"
35-
mavenBom "org.eclipse.jetty:jetty-bom:9.4.42.v20210604"
35+
mavenBom "org.eclipse.jetty:jetty-bom:9.4.43.v20210629"
3636
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.5.10"
3737
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.5.0"
3838
mavenBom "org.jetbrains.kotlinx:kotlinx-serialization-bom:1.2.1"
@@ -127,14 +127,14 @@ configure(allprojects) { project ->
127127
dependency "org.webjars:webjars-locator-core:0.47"
128128
dependency "org.webjars:underscorejs:1.8.3"
129129

130-
dependencySet(group: 'org.apache.tomcat', version: '9.0.48') {
130+
dependencySet(group: 'org.apache.tomcat', version: '9.0.50') {
131131
entry 'tomcat-util'
132132
entry('tomcat-websocket') {
133133
exclude group: "org.apache.tomcat", name: "tomcat-websocket-api"
134134
exclude group: "org.apache.tomcat", name: "tomcat-servlet-api"
135135
}
136136
}
137-
dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.48') {
137+
dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.50') {
138138
entry 'tomcat-embed-core'
139139
entry 'tomcat-embed-websocket'
140140
}
@@ -204,10 +204,10 @@ configure(allprojects) { project ->
204204
}
205205
dependency "io.mockk:mockk:1.11.0"
206206

207-
dependency("net.sourceforge.htmlunit:htmlunit:2.50.0") {
207+
dependency("net.sourceforge.htmlunit:htmlunit:2.51.0") {
208208
exclude group: "commons-logging", name: "commons-logging"
209209
}
210-
dependency("org.seleniumhq.selenium:htmlunit-driver:2.50.0") {
210+
dependency("org.seleniumhq.selenium:htmlunit-driver:2.51.0") {
211211
exclude group: "commons-logging", name: "commons-logging"
212212
}
213213
dependency("org.seleniumhq.selenium:selenium-java:3.141.59") {

spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/webdriver/WebConnectionHtmlUnitDriver.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
2222
import org.openqa.selenium.Capabilities;
2323
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
2424

25-
import org.springframework.lang.Nullable;
2625
import org.springframework.util.Assert;
2726

2827
/**
@@ -35,15 +34,12 @@
3534
*
3635
* @author Rob Winch
3736
* @author Sam Brannen
37+
* @author Juergen Hoeller
3838
* @since 4.2
3939
* @see MockMvcHtmlUnitDriverBuilder
4040
*/
4141
public class WebConnectionHtmlUnitDriver extends HtmlUnitDriver {
4242

43-
@Nullable
44-
private WebClient webClient;
45-
46-
4743
public WebConnectionHtmlUnitDriver() {
4844
}
4945

@@ -72,9 +68,7 @@ public WebConnectionHtmlUnitDriver(Capabilities capabilities) {
7268
*/
7369
@Override
7470
protected final WebClient modifyWebClient(WebClient webClient) {
75-
this.webClient = super.modifyWebClient(webClient);
76-
this.webClient = modifyWebClientInternal(this.webClient);
77-
return this.webClient;
71+
return modifyWebClientInternal(super.modifyWebClient(webClient));
7872
}
7973

8074
/**
@@ -90,13 +84,12 @@ protected WebClient modifyWebClientInternal(WebClient webClient) {
9084
}
9185

9286
/**
93-
* Return the current {@link WebClient}.
87+
* Return the current {@link WebClient} in a public fashion.
9488
* @since 4.3
9589
*/
9690
@Override
9791
public WebClient getWebClient() {
98-
Assert.state(this.webClient != null, "No WebClient set");
99-
return this.webClient;
92+
return super.getWebClient();
10093
}
10194

10295
/**

0 commit comments

Comments
 (0)