From 4d03f89a556774e55a02d7ee01955e8543c7f9b6 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 19 Jan 2022 10:09:31 +0100 Subject: [PATCH] Harmonize dependency upgrades with Spring Boot 2.7.0-M1 Closes gh-29476 --- .../build.gradle | 2 +- .../spring-boot-actuator/build.gradle | 2 +- .../spring-boot-autoconfigure/build.gradle | 4 +- .../spring-boot-dependencies/build.gradle | 74 +++++++++---------- .../spring-boot-starter-undertow/build.gradle | 9 +-- .../WebMvcTestWebDriverIntegrationTests.java | 4 +- .../spring-boot-test/build.gradle | 1 + ...lHostWebConnectionHtmlUnitDriverTests.java | 11 ++- spring-boot-project/spring-boot/build.gradle | 2 +- 9 files changed, 54 insertions(+), 55 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 5612036227..001d00f8a8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -141,7 +141,7 @@ dependencies { testImplementation("com.squareup.okhttp3:mockwebserver") testImplementation("com.jayway.jsonpath:json-path") testImplementation("io.undertow:undertow-core") - testImplementation("io.undertow:undertow-servlet-jakartaee9") { + testImplementation("io.undertow:undertow-servlet-jakarta") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" } testImplementation("jakarta.xml.bind:jakarta.xml.bind-api") diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index acc766b934..57e9b49672 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -30,7 +30,7 @@ dependencies { optional("io.r2dbc:r2dbc-pool") optional("io.r2dbc:r2dbc-spi") optional("io.reactivex:rxjava-reactive-streams") - optional("io.undertow:undertow-servlet-jakartaee9") { + optional("io.undertow:undertow-servlet-jakarta") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" } optional("javax.cache:cache-api") diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 4e10597902..dc32fef9c3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -33,10 +33,10 @@ dependencies { optional("io.r2dbc:r2dbc-pool") optional("io.rsocket:rsocket-core") optional("io.rsocket:rsocket-transport-netty") - optional("io.undertow:undertow-servlet-jakartaee9") { + optional("io.undertow:undertow-servlet-jakarta") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" } - optional("io.undertow:undertow-websockets-jsr-jakartaee9") { + optional("io.undertow:undertow-websockets-jsr-jakarta") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" } optional("jakarta.jms:jakarta.jms-api") diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 0956f80e23..960517047e 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -24,7 +24,7 @@ bom { ] } } - library("AppEngine SDK", "1.9.92") { + library("AppEngine SDK", "1.9.93") { group("com.google.appengine") { modules = [ "appengine-api-1.0-sdk" @@ -55,7 +55,7 @@ bom { ] } } - library("AssertJ", "3.21.0") { + library("AssertJ", "3.22.0") { group("org.assertj") { modules = [ "assertj-core" @@ -72,14 +72,14 @@ bom { ] } } - library("Build Helper Maven Plugin", "3.2.0") { + library("Build Helper Maven Plugin", "3.3.0") { group("org.codehaus.mojo") { plugins = [ "build-helper-maven-plugin" ] } } - library("Byte Buddy", "1.11.22") { + library("Byte Buddy", "1.12.7") { group("net.bytebuddy") { modules = [ "byte-buddy", @@ -87,7 +87,7 @@ bom { ] } } - library("Caffeine", "2.9.2") { + library("Caffeine", "2.9.3") { prohibit("[3.0.0,)") { because "it requires Java 11" } @@ -163,7 +163,7 @@ bom { ] } } - library("DB2 JDBC", "11.5.6.0") { + library("DB2 JDBC", "11.5.7.0") { group("com.ibm.db2") { modules = [ "jcc" @@ -188,7 +188,7 @@ bom { ] } } - library("Dropwizard Metrics", "4.2.4") { + library("Dropwizard Metrics", "4.2.7") { group("io.dropwizard.metrics") { imports = [ "metrics-bom" @@ -337,7 +337,7 @@ bom { ] } } - library("Hibernate", "5.6.1.Final") { + library("Hibernate", "5.6.3.Final") { group("org.hibernate") { modules = [ "hibernate-c3p0", @@ -385,7 +385,7 @@ bom { ] } } - library("HtmlUnit", "2.54.0") { + library("HtmlUnit", "2.56.0") { group("net.sourceforge.htmlunit") { modules = [ "htmlunit" { @@ -394,7 +394,7 @@ bom { ] } } - library("HttpAsyncClient", "4.1.4") { + library("HttpAsyncClient", "4.1.5") { group("org.apache.httpcomponents") { modules = [ "httpasyncclient" { @@ -427,7 +427,7 @@ bom { ] } } - library("HttpCore", "4.4.14") { + library("HttpCore", "4.4.15") { group("org.apache.httpcomponents") { modules = [ "httpcore", @@ -435,7 +435,7 @@ bom { ] } } - library("HttpCore5", "5.1.2") { + library("HttpCore5", "5.1.3") { group("org.apache.httpcomponents.core5") { modules = [ "httpcore5", @@ -451,7 +451,7 @@ bom { ] } } - library("Jackson Bom", "2.13.0") { + library("Jackson Bom", "2.13.1") { group("com.fasterxml.jackson") { imports = [ "jackson-bom" @@ -612,7 +612,7 @@ bom { ] } } - library("Jaybird", "4.0.4.java8") { + library("Jaybird", "4.0.5.java8") { group("org.firebirdsql.jdbc") { modules = [ "jaybird", @@ -620,21 +620,21 @@ bom { ] } } - library("JBoss Logging", "3.4.2.Final") { + library("JBoss Logging", "3.4.3.Final") { group("org.jboss.logging") { modules = [ "jboss-logging" ] } } - library("JDOM2", "2.0.6") { + library("JDOM2", "2.0.6.1") { group("org.jdom") { modules = [ "jdom2" ] } } - library("Jedis", "3.7.1") { + library("Jedis", "3.8.0") { group("redis.clients") { modules = [ "jedis" @@ -725,7 +725,7 @@ bom { ] } } - library("JUnit Jupiter", "5.8.1") { + library("JUnit Jupiter", "5.8.2") { group("org.junit") { imports = [ "junit-bom" @@ -795,7 +795,7 @@ bom { ] } } - library("Logback", "1.2.9") { + library("Logback", "1.2.10") { group("ch.qos.logback") { modules = [ "logback-access", @@ -839,7 +839,7 @@ bom { ] } } - library("Maven Compiler Plugin", "3.8.1") { + library("Maven Compiler Plugin", "3.9.0") { group("org.apache.maven.plugins") { plugins = [ "maven-compiler-plugin" @@ -895,7 +895,7 @@ bom { ] } } - library("Maven Jar Plugin", "3.2.0") { + library("Maven Jar Plugin", "3.2.2") { group("org.apache.maven.plugins") { plugins = [ "maven-jar-plugin" @@ -963,7 +963,7 @@ bom { ] } } - library("Mockito", "4.0.0") { + library("Mockito", "4.2.0") { group("org.mockito") { modules = [ "mockito-core", @@ -983,7 +983,7 @@ bom { ] } } - library("MSSQL JDBC", "9.4.0.jre8") { + library("MSSQL JDBC", "9.4.1.jre8") { group("com.microsoft.sqlserver") { modules = [ "mssql-jdbc" @@ -1006,21 +1006,21 @@ bom { ] } } - library("Neo4j Java Driver", "4.3.6") { + library("Neo4j Java Driver", "4.4.2") { group("org.neo4j.driver") { modules = [ "neo4j-java-driver" ] } } - library("Netty", "4.1.70.Final") { + library("Netty", "4.1.73.Final") { group("io.netty") { imports = [ "netty-bom" ] } } - library("Netty tcNative", "2.0.46.Final") { + library("Netty tcNative", "2.0.47.Final") { group("io.netty") { modules = [ "netty-tcnative", @@ -1046,7 +1046,7 @@ bom { ] } } - library("Oracle Database", "21.3.0.0") { + library("Oracle Database", "21.4.0.0.1") { group("com.oracle.database.jdbc") { imports = [ "ojdbc-bom" @@ -1092,7 +1092,7 @@ bom { ] } } - library("Rabbit AMQP Client", "5.13.1") { + library("Rabbit AMQP Client", "5.14.1") { group("com.rabbitmq") { modules = [ "amqp-client" @@ -1230,7 +1230,7 @@ bom { ] } } - library("Selenium", "3.141.59") { + library("Selenium", "4.1.1") { group("org.seleniumhq.selenium") { modules = [ "selenium-api", @@ -1246,14 +1246,14 @@ bom { ] } } - library("Selenium HtmlUnit", "2.54.0") { + library("Selenium HtmlUnit", "3.56.0") { group("org.seleniumhq.selenium") { modules = [ "htmlunit-driver" ] } } - library("SendGrid", "4.7.6") { + library("SendGrid", "4.8.2") { group("com.sendgrid") { modules = [ "sendgrid-java" @@ -1267,7 +1267,7 @@ bom { ] } } - library("SLF4J", "1.7.32") { + library("SLF4J", "1.7.33") { group("org.slf4j") { modules = [ "jcl-over-slf4j", @@ -1283,7 +1283,7 @@ bom { ] } } - library("SnakeYAML", "1.29") { + library("SnakeYAML", "1.30") { group("org.yaml") { modules = [ "snakeyaml" @@ -1498,12 +1498,12 @@ bom { ] } } - library("Undertow", "2.2.12.Final") { + library("Undertow", "2.2.14.Final") { group("io.undertow") { modules = [ "undertow-core", - "undertow-servlet-jakartaee9", - "undertow-websockets-jsr-jakartaee9" + "undertow-servlet-jakarta", + "undertow-websockets-jsr-jakarta" ] } } @@ -1535,7 +1535,7 @@ bom { ] } } - library("XmlUnit2", "2.8.3") { + library("XmlUnit2", "2.8.4") { group("org.xmlunit") { modules = [ "xmlunit-assertj", diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle index 7387e4c2c1..2a42b525ab 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle @@ -6,13 +6,8 @@ description = "Starter for using Undertow as the embedded servlet container. An dependencies { api("io.undertow:undertow-core") - api("io.undertow:undertow-servlet-jakartaee9") { - exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - } - api("io.undertow:undertow-websockets-jsr-jakartaee9") { - exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" - exclude group: "jakarta.websocket", module: "jakarta.websocket-client-api" - } + api("io.undertow:undertow-servlet-jakarta") + api("io.undertow:undertow-websockets-jsr-jakarta") api("jakarta.websocket:jakarta.websocket-api") api("org.apache.tomcat.embed:tomcat-embed-el") } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebDriverIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebDriverIntegrationTests.java index 519dedc05a..534fdae23a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebDriverIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebDriverIntegrationTests.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchWindowException; +import org.openqa.selenium.NoSuchSessionException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; @@ -59,7 +59,7 @@ class WebMvcTestWebDriverIntegrationTests { this.webDriver.get("/html"); WebElement element = this.webDriver.findElement(By.tagName("body")); assertThat(element.getText()).isEqualTo("Hello"); - assertThatExceptionOfType(NoSuchWindowException.class).isThrownBy(previousWebDriver::getWindowHandle); + assertThatExceptionOfType(NoSuchSessionException.class).isThrownBy(previousWebDriver::getWindowHandle); assertThat(previousWebDriver).isNotNull().isNotSameAs(this.webDriver); } diff --git a/spring-boot-project/spring-boot-test/build.gradle b/spring-boot-project/spring-boot-test/build.gradle index dc37c1cf72..1f5ae74c83 100644 --- a/spring-boot-project/spring-boot-test/build.gradle +++ b/spring-boot-project/spring-boot-test/build.gradle @@ -44,6 +44,7 @@ dependencies { testImplementation("io.mockk:mockk") testImplementation("jakarta.json:jakarta.json-api") testImplementation("ch.qos.logback:logback-classic") + testImplementation("com.squareup.okhttp3:okhttp") testImplementation("org.apache.tomcat.embed:tomcat-embed-core") testImplementation("org.codehaus.groovy:groovy") testImplementation("org.codehaus.groovy:groovy-xml") diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java index 053cb54344..2e4b3b3bff 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java @@ -35,8 +35,8 @@ import org.springframework.core.env.Environment; import org.springframework.mock.env.MockEnvironment; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -55,6 +55,9 @@ class LocalHostWebConnectionHtmlUnitDriverTests { this.webClient = webClient; given(this.webClient.getOptions()).willReturn(new WebClientOptions()); given(this.webClient.getWebConsole()).willReturn(new WebConsole()); + WebWindow currentWindow = mock(WebWindow.class); + given(currentWindow.isClosed()).willReturn(false); + given(this.webClient.getCurrentWindow()).willReturn(currentWindow); } @Test @@ -80,7 +83,7 @@ class LocalHostWebConnectionHtmlUnitDriverTests { void createWithCapabilitiesWhenEnvironmentIsNullWillThrowException() { Capabilities capabilities = mock(Capabilities.class); given(capabilities.getBrowserName()).willReturn("htmlunit"); - given(capabilities.getVersion()).willReturn("chrome"); + given(capabilities.getBrowserVersion()).willReturn("chrome"); assertThatIllegalArgumentException() .isThrownBy(() -> new LocalHostWebConnectionHtmlUnitDriver(null, capabilities)) .withMessageContaining("Environment must not be null"); @@ -91,7 +94,7 @@ class LocalHostWebConnectionHtmlUnitDriverTests { MockEnvironment environment = new MockEnvironment(); LocalHostWebConnectionHtmlUnitDriver driver = new TestLocalHostWebConnectionHtmlUnitDriver(environment); driver.get("/test"); - verify(this.webClient).getPage(any(WebWindow.class), requestToUrl(new URL("http://localhost:8080/test"))); + verify(this.webClient).getPage(isNull(), requestToUrl(new URL("http://localhost:8080/test"))); } @Test @@ -100,7 +103,7 @@ class LocalHostWebConnectionHtmlUnitDriverTests { environment.setProperty("local.server.port", "8181"); LocalHostWebConnectionHtmlUnitDriver driver = new TestLocalHostWebConnectionHtmlUnitDriver(environment); driver.get("/test"); - verify(this.webClient).getPage(any(WebWindow.class), requestToUrl(new URL("http://localhost:8181/test"))); + verify(this.webClient).getPage(isNull(), requestToUrl(new URL("http://localhost:8181/test"))); } private WebRequest requestToUrl(URL url) { diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle index b48c3902a9..9d39951b64 100644 --- a/spring-boot-project/spring-boot/build.gradle +++ b/spring-boot-project/spring-boot/build.gradle @@ -35,7 +35,7 @@ dependencies { optional("io.r2dbc:r2dbc-pool") optional("io.rsocket:rsocket-core") optional("io.rsocket:rsocket-transport-netty") - optional("io.undertow:undertow-servlet-jakartaee9") { + optional("io.undertow:undertow-servlet-jakarta") { exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.3_spec" } optional("jakarta.jms:jakarta.jms-api")