Skip to content

Commit 17ca042

Browse files
snicollwilkinsona
authored andcommitted
Upgrade to HtmlUnit 4.2.0 and Selenium HtmlUnit 4.20
Closes gh-41178 Closes gh-41179
1 parent 6d99770 commit 17ca042

File tree

18 files changed

+57
-57
lines changed

18 files changed

+57
-57
lines changed

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ bom {
563563
]
564564
}
565565
}
566-
library("HtmlUnit", "2.70.0") {
567-
group("net.sourceforge.htmlunit") {
566+
library("HtmlUnit", "4.2.0") {
567+
group("org.htmlunit") {
568568
modules = [
569569
"htmlunit" {
570570
exclude group: "commons-logging", module: "commons-logging"
@@ -1826,10 +1826,10 @@ bom {
18261826
releaseNotes("https://github.com/SeleniumHQ/selenium/releases/tag/selenium-{version}")
18271827
}
18281828
}
1829-
library("Selenium HtmlUnit", "4.13.0") {
1829+
library("Selenium HtmlUnit", "4.20.0") {
18301830
group("org.seleniumhq.selenium") {
18311831
modules = [
1832-
"htmlunit-driver"
1832+
"htmlunit3-driver"
18331833
]
18341834
}
18351835
links {

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ dependencies {
8080
implementation("jakarta.persistence:jakarta.persistence-api")
8181
implementation("jakarta.servlet:jakarta.servlet-api")
8282
implementation("jakarta.validation:jakarta.validation-api")
83-
implementation("net.sourceforge.htmlunit:htmlunit") {
84-
exclude group: "commons-logging", module: "commons-logging"
85-
exclude group: "xml-apis", module: "xml-apis"
86-
}
8783
implementation("org.apache.httpcomponents.client5:httpclient5")
8884
implementation("org.apache.commons:commons-dbcp2") {
8985
exclude group: "commons-logging", module: "commons-logging"
@@ -102,6 +98,10 @@ dependencies {
10298
exclude group: "javax.xml.bind", module: "jaxb-api"
10399
exclude group: "org.jboss.spec.javax.transaction", module: "jboss-transaction-api_1.2_spec"
104100
}
101+
implementation("org.htmlunit:htmlunit") {
102+
exclude group: "commons-logging", module: "commons-logging"
103+
exclude group: "xml-apis", module: "xml-apis"
104+
}
105105
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
106106
implementation("org.jooq:jooq") {
107107
exclude group: "javax.xml.bind", module: "jaxb-api"

spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/springmvctests/MyHtmlUnitTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package org.springframework.boot.docs.testing.springbootapplications.springmvctests;
1818

19-
import com.gargoylesoftware.htmlunit.WebClient;
20-
import com.gargoylesoftware.htmlunit.html.HtmlPage;
19+
import org.htmlunit.WebClient;
20+
import org.htmlunit.html.HtmlPage;
2121
import org.junit.jupiter.api.Test;
2222

2323
import org.springframework.beans.factory.annotation.Autowired;

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/springbootapplications/springmvctests/MyHtmlUnitTests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package org.springframework.boot.docs.features.testing.springbootapplications.springmvctests
1818

19-
import com.gargoylesoftware.htmlunit.WebClient
20-
import com.gargoylesoftware.htmlunit.html.HtmlPage
2119
import org.assertj.core.api.Assertions.assertThat
20+
import org.htmlunit.WebClient
21+
import org.htmlunit.html.HtmlPage
2222
import org.junit.jupiter.api.Test
2323
import org.mockito.BDDMockito.given
2424
import org.springframework.beans.factory.annotation.Autowired

spring-boot-project/spring-boot-test-autoconfigure/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ dependencies {
2020
optional("com.google.code.gson:gson")
2121
optional("com.jayway.jsonpath:json-path")
2222
optional("com.sun.xml.messaging.saaj:saaj-impl")
23-
optional("net.sourceforge.htmlunit:htmlunit") {
23+
optional("org.hibernate.orm:hibernate-core")
24+
optional("org.htmlunit:htmlunit") {
2425
exclude group: "commons-logging", module: "commons-logging"
2526
}
26-
optional("org.hibernate.orm:hibernate-core")
2727
optional("org.junit.jupiter:junit-jupiter-api")
28-
optional("org.seleniumhq.selenium:htmlunit-driver") {
28+
optional("org.seleniumhq.selenium:htmlunit3-driver") {
2929
exclude(group: "commons-logging", module: "commons-logging")
3030
exclude(group: "com.sun.activation", module: "jakarta.activation")
3131
}

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2024 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.
@@ -23,7 +23,7 @@
2323
import java.lang.annotation.RetentionPolicy;
2424
import java.lang.annotation.Target;
2525

26-
import com.gargoylesoftware.htmlunit.WebClient;
26+
import org.htmlunit.WebClient;
2727
import org.openqa.selenium.WebDriver;
2828

2929
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcWebClientAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 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.
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.boot.test.autoconfigure.web.servlet;
1818

19-
import com.gargoylesoftware.htmlunit.WebClient;
19+
import org.htmlunit.WebClient;
2020

2121
import org.springframework.boot.autoconfigure.AutoConfiguration;
2222
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcWebDriverAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 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.
@@ -18,7 +18,7 @@
1818

1919
import java.util.concurrent.Executors;
2020

21-
import com.gargoylesoftware.htmlunit.BrowserVersion;
21+
import org.htmlunit.BrowserVersion;
2222
import org.openqa.selenium.WebDriver;
2323
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
2424

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebClientIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2024 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.
@@ -16,8 +16,8 @@
1616

1717
package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc;
1818

19-
import com.gargoylesoftware.htmlunit.WebClient;
20-
import com.gargoylesoftware.htmlunit.html.HtmlPage;
19+
import org.htmlunit.WebClient;
20+
import org.htmlunit.html.HtmlPage;
2121
import org.junit.jupiter.api.Test;
2222

2323
import org.springframework.beans.factory.annotation.Autowired;

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebDriverIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 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.
@@ -20,7 +20,7 @@
2020
import org.junit.jupiter.api.Test;
2121
import org.junit.jupiter.api.TestMethodOrder;
2222
import org.openqa.selenium.By;
23-
import org.openqa.selenium.NoSuchWindowException;
23+
import org.openqa.selenium.NoSuchSessionException;
2424
import org.openqa.selenium.WebDriver;
2525
import org.openqa.selenium.WebElement;
2626

@@ -59,7 +59,7 @@ void shouldBeADifferentWebClient() {
5959
this.webDriver.get("/html");
6060
WebElement element = this.webDriver.findElement(By.tagName("body"));
6161
assertThat(element.getText()).isEqualTo("Hello");
62-
assertThatExceptionOfType(NoSuchWindowException.class).isThrownBy(previousWebDriver::getWindowHandle);
62+
assertThatExceptionOfType(NoSuchSessionException.class).isThrownBy(previousWebDriver::getWindowHandle);
6363
assertThat(previousWebDriver).isNotNull().isNotSameAs(this.webDriver);
6464
}
6565

0 commit comments

Comments
 (0)