diff --git a/settings.gradle b/settings.gradle index 378c255f4f6..32d9e97e4f9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -137,6 +137,7 @@ include "spring-boot-project:spring-boot-tx" include "spring-boot-project:spring-boot-undertow" include "spring-boot-project:spring-boot-validation" include "spring-boot-project:spring-boot-webmvc" +include "spring-boot-project:spring-boot-webservices" include "spring-boot-system-tests:spring-boot-deployment-tests" include "spring-boot-system-tests:spring-boot-image-tests" include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests" diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilder.java b/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilder.java deleted file mode 100644 index a34a688291a..00000000000 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilder.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2012-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.webservices.client; - -import java.time.Duration; -import java.util.function.Function; -import java.util.function.Supplier; - -import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder; -import org.springframework.boot.http.client.ClientHttpRequestFactorySettings; -import org.springframework.boot.http.client.JdkClientHttpRequestFactoryBuilder; -import org.springframework.boot.ssl.SslBundle; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.util.Assert; -import org.springframework.ws.transport.WebServiceMessageSender; - -/** - * {@link WebServiceMessageSender} builder that can detect a suitable HTTP library based - * on the classpath. - * - * @author Stephane Nicoll - * @since 2.1.0 - * @deprecated since 3.4.0 in favor of - * {@link WebServiceMessageSenderFactory#http(ClientHttpRequestFactorySettings)} - */ -@Deprecated(since = "3.4.0", forRemoval = true) -public class HttpWebServiceMessageSenderBuilder { - - private ClientHttpRequestFactoryBuilder requestFactoryBuilder; - - private ClientHttpRequestFactorySettings requestFactorySettings = ClientHttpRequestFactorySettings.defaults(); - - /** - * Set the connection timeout. - * @param connectTimeout the connection timeout - * @return the current builder instance - */ - public HttpWebServiceMessageSenderBuilder setConnectTimeout(Duration connectTimeout) { - this.requestFactorySettings = this.requestFactorySettings.withConnectTimeout(connectTimeout); - return this; - } - - /** - * Set the read timeout. - * @param readTimeout the read timeout - * @return the current builder instance - */ - public HttpWebServiceMessageSenderBuilder setReadTimeout(Duration readTimeout) { - this.requestFactorySettings = this.requestFactorySettings.withReadTimeout(readTimeout); - return this; - } - - /** - * Set an {@link SslBundle} that will be used to configure a secure connection. - * @param sslBundle the SSL bundle - * @return the current builder instance - */ - public HttpWebServiceMessageSenderBuilder sslBundle(SslBundle sslBundle) { - this.requestFactorySettings = this.requestFactorySettings.withSslBundle(sslBundle); - return this; - } - - /** - * Set the {@code Supplier} of {@link ClientHttpRequestFactory} that should be called - * to create the HTTP-based {@link WebServiceMessageSender}. - * @param requestFactorySupplier the supplier for the request factory - * @return the current builder instance - */ - public HttpWebServiceMessageSenderBuilder requestFactory( - Supplier requestFactorySupplier) { - Assert.notNull(requestFactorySupplier, "'requestFactorySupplier' must not be null"); - this.requestFactoryBuilder = ClientHttpRequestFactoryBuilder.of(requestFactorySupplier); - return this; - } - - /** - * Set the {@code Function} of {@link ClientHttpRequestFactorySettings} to - * {@link ClientHttpRequestFactory} that should be called to create the HTTP-based - * {@link WebServiceMessageSender}. - * @param requestFactoryFunction the function for the request factory - * @return the current builder instance - * @since 3.0.0 - */ - public HttpWebServiceMessageSenderBuilder requestFactory( - Function requestFactoryFunction) { - Assert.notNull(requestFactoryFunction, "'requestFactoryFunction' must not be null"); - this.requestFactoryBuilder = requestFactoryFunction::apply; - return this; - } - - /** - * Set the {@link ClientHttpRequestFactoryBuilder} to use when creating the HTTP-based - * {@link WebServiceMessageSender}. - * @param requestFactoryBuilder the {@link ClientHttpRequestFactoryBuilder} to use - * @return this builder instance - * @since 3.4.0 - */ - public HttpWebServiceMessageSenderBuilder requestFactoryBuilder( - ClientHttpRequestFactoryBuilder requestFactoryBuilder) { - Assert.notNull(requestFactoryBuilder, "'requestFactoryBuilder' must not be null"); - this.requestFactoryBuilder = requestFactoryBuilder; - return this; - } - - /** - * Build the {@link WebServiceMessageSender} instance. - * @return the {@link WebServiceMessageSender} instance - */ - public WebServiceMessageSender build() { - ClientHttpRequestFactoryBuilder requestFactoryBuilder = getOrDetectRequestFactoryBuilder(); - return WebServiceMessageSenderFactory.http(requestFactoryBuilder, this.requestFactorySettings) - .getWebServiceMessageSender(); - } - - private ClientHttpRequestFactoryBuilder getOrDetectRequestFactoryBuilder() { - if (this.requestFactoryBuilder != null) { - return this.requestFactoryBuilder; - } - ClientHttpRequestFactoryBuilder builder = ClientHttpRequestFactoryBuilder.detect(); - if (builder instanceof JdkClientHttpRequestFactoryBuilder) { - // Same logic as earlier versions which did not support JDK client factories - return ClientHttpRequestFactoryBuilder.simple(); - } - return builder; - } - -} diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderJettyClientIntegrationTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderJettyClientIntegrationTests.java deleted file mode 100644 index 19e35dcf7ab..00000000000 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderJettyClientIntegrationTests.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2012-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.webservices.client; - -import java.time.Duration; - -import org.eclipse.jetty.client.HttpClient; -import org.junit.jupiter.api.Test; - -import org.springframework.boot.testsupport.classpath.ClassPathExclusions; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.JettyClientHttpRequestFactory; -import org.springframework.test.util.ReflectionTestUtils; -import org.springframework.ws.transport.WebServiceMessageSender; -import org.springframework.ws.transport.http.ClientHttpRequestMessageSender; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link HttpWebServiceMessageSenderBuilder} when Http Components is not - * available and, therefore, Jetty's client is used instead. - * - * @author Stephane Nicoll - * @deprecated since 3.4.0 for removal in 4.0.0 - */ -@ClassPathExclusions("httpclient5-*.jar") -@SuppressWarnings("removal") -@Deprecated(since = "3.4.0", forRemoval = true) -class HttpWebServiceMessageSenderBuilderJettyClientIntegrationTests { - - private final HttpWebServiceMessageSenderBuilder builder = new HttpWebServiceMessageSenderBuilder(); - - @Test - void buildUseJettyClientIfHttpComponentsIsNotAvailable() { - WebServiceMessageSender messageSender = this.builder.build(); - assertJettyClientHttpRequestFactory(messageSender); - } - - @Test - void buildWithCustomTimeouts() { - WebServiceMessageSender messageSender = this.builder.setConnectTimeout(Duration.ofSeconds(5)) - .setReadTimeout(Duration.ofSeconds(2)) - .build(); - JettyClientHttpRequestFactory factory = assertJettyClientHttpRequestFactory(messageSender); - HttpClient client = (HttpClient) ReflectionTestUtils.getField(factory, "httpClient"); - assertThat(client).isNotNull(); - assertThat(client.getConnectTimeout()).isEqualTo(5000); - assertThat(factory).hasFieldOrPropertyWithValue("readTimeout", 2000L); - } - - private JettyClientHttpRequestFactory assertJettyClientHttpRequestFactory(WebServiceMessageSender messageSender) { - assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class); - ClientHttpRequestMessageSender sender = (ClientHttpRequestMessageSender) messageSender; - ClientHttpRequestFactory requestFactory = sender.getRequestFactory(); - assertThat(requestFactory).isInstanceOf(JettyClientHttpRequestFactory.class); - return (JettyClientHttpRequestFactory) requestFactory; - } - -} diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderReactorClientIntegrationTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderReactorClientIntegrationTests.java deleted file mode 100644 index df46bd9d6fd..00000000000 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderReactorClientIntegrationTests.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2012-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.webservices.client; - -import java.time.Duration; - -import io.netty.channel.ChannelOption; -import org.assertj.core.api.InstanceOfAssertFactories; -import org.junit.jupiter.api.Test; -import reactor.netty.http.client.HttpClient; - -import org.springframework.boot.testsupport.classpath.ClassPathExclusions; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.ReactorClientHttpRequestFactory; -import org.springframework.ws.transport.WebServiceMessageSender; -import org.springframework.ws.transport.http.ClientHttpRequestMessageSender; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link HttpWebServiceMessageSenderBuilder} when Reactor Netty is the - * predominant HTTP client. - * - * @author Andy Wilkinson - * @deprecated since 3.4.0 for removal in 4.0.0 - */ -@ClassPathExclusions({ "httpclient5-*.jar", "jetty-client-*.jar" }) -@SuppressWarnings("removal") -@Deprecated(since = "3.4.0", forRemoval = true) -class HttpWebServiceMessageSenderBuilderReactorClientIntegrationTests { - - private final HttpWebServiceMessageSenderBuilder builder = new HttpWebServiceMessageSenderBuilder(); - - @Test - void buildUsesReactorClientIfHttpComponentsAndJettyAreNotAvailable() { - WebServiceMessageSender messageSender = this.builder.build(); - assertReactorClientHttpRequestFactory(messageSender); - } - - @Test - void buildWithCustomTimeouts() { - WebServiceMessageSender messageSender = this.builder.setConnectTimeout(Duration.ofSeconds(5)) - .setReadTimeout(Duration.ofSeconds(2)) - .build(); - ReactorClientHttpRequestFactory factory = assertReactorClientHttpRequestFactory(messageSender); - assertThat(factory).extracting("httpClient", InstanceOfAssertFactories.type(HttpClient.class)) - .extracting((httpClient) -> httpClient.configuration().options(), InstanceOfAssertFactories.MAP) - .containsEntry(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000); - assertThat(factory).hasFieldOrPropertyWithValue("readTimeout", Duration.ofSeconds(2)); - } - - private ReactorClientHttpRequestFactory assertReactorClientHttpRequestFactory( - WebServiceMessageSender messageSender) { - assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class); - ClientHttpRequestMessageSender sender = (ClientHttpRequestMessageSender) messageSender; - ClientHttpRequestFactory requestFactory = sender.getRequestFactory(); - assertThat(requestFactory).isInstanceOf(ReactorClientHttpRequestFactory.class); - return (ReactorClientHttpRequestFactory) requestFactory; - } - -} diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderSimpleIntegrationTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderSimpleIntegrationTests.java deleted file mode 100644 index 9be6a000d02..00000000000 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderSimpleIntegrationTests.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2012-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.webservices.client; - -import java.time.Duration; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.testsupport.classpath.ClassPathExclusions; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.SimpleClientHttpRequestFactory; -import org.springframework.ws.transport.WebServiceMessageSender; -import org.springframework.ws.transport.http.ClientHttpRequestMessageSender; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link HttpWebServiceMessageSenderBuilder} when no preferred HTTP clients are - * available - * - * @author Stephane Nicoll - * @deprecated since 3.4.0 for removal in 4.0.0 - */ -@ClassPathExclusions({ "httpclient5-*.jar", "jetty-client-*.jar", "reactor-netty-http-*.jar" }) -@SuppressWarnings("removal") -@Deprecated(since = "3.4.0", forRemoval = true) -class HttpWebServiceMessageSenderBuilderSimpleIntegrationTests { - - private final HttpWebServiceMessageSenderBuilder builder = new HttpWebServiceMessageSenderBuilder(); - - @Test - void buildUseUseSimpleClientByDefault() { - WebServiceMessageSender messageSender = this.builder.build(); - assertSimpleClientRequestFactory(messageSender); - } - - @Test - void buildWithCustomTimeouts() { - WebServiceMessageSender messageSender = this.builder.setConnectTimeout(Duration.ofSeconds(5)) - .setReadTimeout(Duration.ofSeconds(2)) - .build(); - SimpleClientHttpRequestFactory requestFactory = assertSimpleClientRequestFactory(messageSender); - assertThat(requestFactory).hasFieldOrPropertyWithValue("connectTimeout", 5000); - assertThat(requestFactory).hasFieldOrPropertyWithValue("readTimeout", 2000); - } - - private SimpleClientHttpRequestFactory assertSimpleClientRequestFactory(WebServiceMessageSender messageSender) { - assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class); - ClientHttpRequestMessageSender sender = (ClientHttpRequestMessageSender) messageSender; - ClientHttpRequestFactory requestFactory = sender.getRequestFactory(); - assertThat(requestFactory).isInstanceOf(SimpleClientHttpRequestFactory.class); - return (SimpleClientHttpRequestFactory) requestFactory; - } - -} diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderTests.java b/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderTests.java deleted file mode 100644 index 91cb09d2b73..00000000000 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/HttpWebServiceMessageSenderBuilderTests.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2012-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.webservices.client; - -import java.time.Duration; - -import org.junit.jupiter.api.Test; - -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; -import org.springframework.http.client.SimpleClientHttpRequestFactory; -import org.springframework.ws.transport.WebServiceMessageSender; -import org.springframework.ws.transport.http.ClientHttpRequestMessageSender; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; - -/** - * Tests for {@link HttpWebServiceMessageSenderBuilder}. - * - * @author Stephane Nicoll - * @deprecated since 3.4.0 for removal in 4.0.0 - */ -@SuppressWarnings("removal") -@Deprecated(since = "3.4.0", forRemoval = true) -class HttpWebServiceMessageSenderBuilderTests { - - @Test - void buildWithRequestFactorySupplier() { - ClientHttpRequestFactory requestFactory = mock(ClientHttpRequestFactory.class); - ClientHttpRequestMessageSender messageSender = build( - new HttpWebServiceMessageSenderBuilder().requestFactory(() -> requestFactory)); - assertThat(messageSender.getRequestFactory()).isSameAs(requestFactory); - } - - @Test - void buildWithReadAndConnectTimeout() { - ClientHttpRequestMessageSender messageSender = build( - new HttpWebServiceMessageSenderBuilder().requestFactory(SimpleClientHttpRequestFactory::new) - .setConnectTimeout(Duration.ofSeconds(5)) - .setReadTimeout(Duration.ofSeconds(2))); - SimpleClientHttpRequestFactory requestFactory = (SimpleClientHttpRequestFactory) messageSender - .getRequestFactory(); - assertThat(requestFactory).hasFieldOrPropertyWithValue("connectTimeout", 5000); - assertThat(requestFactory).hasFieldOrPropertyWithValue("readTimeout", 2000); - } - - @Test - void buildUsesHttpComponentsByDefault() { - ClientHttpRequestMessageSender messageSender = build( - new HttpWebServiceMessageSenderBuilder().setConnectTimeout(Duration.ofSeconds(5)) - .setReadTimeout(Duration.ofSeconds(5))); - ClientHttpRequestFactory requestFactory = messageSender.getRequestFactory(); - assertThat(requestFactory).isInstanceOf(HttpComponentsClientHttpRequestFactory.class); - } - - private ClientHttpRequestMessageSender build(HttpWebServiceMessageSenderBuilder builder) { - WebServiceMessageSender messageSender = builder.build(); - assertThat(messageSender).isInstanceOf(ClientHttpRequestMessageSender.class); - return ((ClientHttpRequestMessageSender) messageSender); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index fe399b9f827..39b860d75ca 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -197,13 +197,6 @@ dependencies { optional("org.springframework.session:spring-session-jdbc") optional("org.springframework.amqp:spring-rabbit") optional("org.springframework.amqp:spring-rabbit-stream") - optional("org.springframework.ws:spring-ws-core") { - exclude group: "com.sun.mail", module: "jakarta.mail" - exclude group: "jakarta.platform", module: "jakarta.jakartaee-api" - exclude group: "org.eclipse.jetty", module: "jetty-server" - exclude group: "org.eclipse.jetty", module: "jetty-servlet" - exclude group: "jakarta.mail", module: "jakarta.mail-api" - } optional("redis.clients:jedis") testImplementation(project(":spring-boot-project:spring-boot-freemarker")) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json index f95d8df1585..0b16c301096 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -808,11 +808,6 @@ "reason": "Replaced by the PartEventHttpMessageReader and the PartEvent API.", "level": "error" } - }, - { - "name": "spring.webservices.wsdl-locations", - "type": "java.util.List", - "description": "Comma-separated list of locations of WSDLs and accompanying XSDs to be exposed as beans." } ], "hints": [ diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 8bf181d1b60..29865e8f222 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -59,5 +59,3 @@ org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAut org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration org.springframework.boot.autoconfigure.websocket.servlet.WebSocketMessagingAutoConfiguration -org.springframework.boot.autoconfigure.webservices.WebServicesAutoConfiguration -org.springframework.boot.autoconfigure.webservices.client.WebServiceTemplateAutoConfiguration diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 832c6ff0801..3a6432a8fb9 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2103,7 +2103,8 @@ bom { "spring-boot-tx", "spring-boot-undertow", "spring-boot-validation", - "spring-boot-webmvc" + "spring-boot-webmvc", + "spring-boot-webservices" ] plugins = [ "spring-boot-maven-plugin" diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 053acdc0f7e..578f474803a 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -128,6 +128,7 @@ dependencies { autoConfiguration(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-validation", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "autoConfigurationMetadata")) + autoConfiguration(project(path: ":spring-boot-project:spring-boot-webservices", configuration: "autoConfigurationMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-activemq", configuration: "configurationPropertiesMetadata")) @@ -183,6 +184,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-tx", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-webservices", configuration: "configurationPropertiesMetadata")) dokkatoo(project(path: ":spring-boot-project:spring-boot-all")) dokkatoo(project(path: ":spring-boot-project:spring-boot-test")) @@ -214,6 +216,7 @@ dependencies { implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools")) implementation(project(path: ":spring-boot-project:spring-boot-undertow")) implementation(project(path: ":spring-boot-project:spring-boot-webmvc")) + implementation(project(path: ":spring-boot-project:spring-boot-webservices")) implementation("ch.qos.logback:logback-classic") implementation("com.redis:testcontainers-redis") implementation("com.zaxxer:HikariCP") diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle index f3dbb8dc7b1..29b5eaa39e6 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle @@ -22,8 +22,7 @@ description = "Starter for using Spring Web Services" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) + api(project(":spring-boot-project:spring-boot-webservices")) api("com.sun.xml.messaging.saaj:saaj-impl") api("jakarta.xml.ws:jakarta.xml.ws-api") - api("org.springframework:spring-oxm") - api("org.springframework.ws:spring-ws-core") } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index 0281c651484..7e1c13dc90b 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -77,6 +77,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-tx")) optional(project(":spring-boot-project:spring-boot-validation")) optional(project(":spring-boot-project:spring-boot-webmvc")) + optional(project(":spring-boot-project:spring-boot-webservices")) optional("jakarta.json.bind:jakarta.json.bind-api") optional("jakarta.persistence:jakarta.persistence-api") optional("jakarta.servlet:jakarta.servlet-api") diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientTemplateAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientTemplateAutoConfiguration.java index bc2cf59adc5..0d0b23a4de4 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientTemplateAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientTemplateAutoConfiguration.java @@ -20,7 +20,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.webservices.client.WebServiceTemplateAutoConfiguration; +import org.springframework.boot.webservices.autoconfigure.client.WebServiceTemplateAutoConfiguration; import org.springframework.boot.webservices.client.WebServiceTemplateBuilder; import org.springframework.context.annotation.Bean; import org.springframework.ws.client.core.WebServiceTemplate; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.client.AutoConfigureWebServiceClient.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.client.AutoConfigureWebServiceClient.imports index 2c83655f0dc..b3ca63de69a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.client.AutoConfigureWebServiceClient.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.client.AutoConfigureWebServiceClient.imports @@ -1,3 +1,3 @@ # AutoConfigureWebServiceClient org.springframework.boot.test.autoconfigure.webservices.client.WebServiceClientTemplateAutoConfiguration -org.springframework.boot.autoconfigure.webservices.client.WebServiceTemplateAutoConfiguration \ No newline at end of file +org.springframework.boot.webservices.autoconfigure.client.WebServiceTemplateAutoConfiguration diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.server.AutoConfigureWebServiceServer.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.server.AutoConfigureWebServiceServer.imports index cc7f617ba2b..333a6d3c7aa 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.server.AutoConfigureWebServiceServer.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.webservices.server.AutoConfigureWebServiceServer.imports @@ -1,2 +1,2 @@ # AutoConfigureWebServiceServer auto-configuration imports -org.springframework.boot.autoconfigure.webservices.WebServicesAutoConfiguration \ No newline at end of file +org.springframework.boot.webservices.autoconfigure.WebServicesAutoConfiguration \ No newline at end of file diff --git a/spring-boot-project/spring-boot-webservices/build.gradle b/spring-boot-project/spring-boot-webservices/build.gradle new file mode 100644 index 00000000000..185fa4b1ae5 --- /dev/null +++ b/spring-boot-project/spring-boot-webservices/build.gradle @@ -0,0 +1,43 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +plugins { + id "java-library" + id "org.springframework.boot.auto-configuration" + id "org.springframework.boot.configuration-properties" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Web Services" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("org.springframework:spring-oxm") + api("org.springframework.ws:spring-ws-core") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional("jakarta.servlet:jakarta.servlet-api") + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation("org.eclipse.jetty:jetty-client") + + testRuntimeOnly("ch.qos.logback:logback-classic") + testRuntimeOnly("io.projectreactor.netty:reactor-netty-http") + testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5") +} diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsCondition.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsCondition.java index 9781ce13452..b7e6eeadb0c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsCondition.java +++ b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsCondition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices; +package org.springframework.boot.webservices.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.OnPropertyListCondition; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfiguration.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfiguration.java index 56d9bbadfeb..6267af6e55a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices; +package org.springframework.boot.webservices.autoconfigure; import java.io.IOException; import java.util.Collections; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesProperties.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesProperties.java index 5171edd5b32..7149635fd86 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java +++ b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/WebServicesProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices; +package org.springframework.boot.webservices.autoconfigure; import java.util.HashMap; import java.util.Map; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfiguration.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfiguration.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfiguration.java index 7de090fd2d7..c02b837a641 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices.client; +package org.springframework.boot.webservices.autoconfigure.client; import java.util.List; @@ -23,7 +23,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration; import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder; import org.springframework.boot.http.client.ClientHttpRequestFactorySettings; import org.springframework.boot.webservices.client.WebServiceMessageSenderFactory; @@ -38,9 +37,9 @@ import org.springframework.ws.client.core.WebServiceTemplate; * {@link EnableAutoConfiguration Auto-configuration} for {@link WebServiceTemplate}. * * @author Dmytro Nosan - * @since 2.1.0 + * @since 4.0.0 */ -@AutoConfiguration(after = HttpClientAutoConfiguration.class) +@AutoConfiguration @ConditionalOnClass({ WebServiceTemplate.class, Unmarshaller.class, Marshaller.class }) public class WebServiceTemplateAutoConfiguration { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/package-info.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/package-info.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/package-info.java index ea002ccffa6..886110ca10c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/client/package-info.java +++ b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/client/package-info.java @@ -17,4 +17,4 @@ /** * Auto-configuration for Spring Web Services Clients. */ -package org.springframework.boot.autoconfigure.webservices.client; +package org.springframework.boot.webservices.autoconfigure.client; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/package-info.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/package-info.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/package-info.java index 2b6728fcdca..344d4fd28cb 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/webservices/package-info.java +++ b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/autoconfigure/package-info.java @@ -17,4 +17,4 @@ /** * Auto-configuration for Spring Web Services. */ -package org.springframework.boot.autoconfigure.webservices; +package org.springframework.boot.webservices.autoconfigure; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactory.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactory.java similarity index 100% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactory.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactory.java diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java index 445f54ff2cf..e5f110fdd9a 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java +++ b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java @@ -117,7 +117,6 @@ public class WebServiceTemplateBuilder { * @param messageSenderFactory the {@link WebServiceMessageSenderFactory} to use * @return a new builder instance * @since 3.4.0 - * @see HttpWebServiceMessageSenderBuilder */ public WebServiceTemplateBuilder httpMessageSenderFactory(WebServiceMessageSenderFactory messageSenderFactory) { Assert.notNull(messageSenderFactory, "'messageSenderFactory' must not be null"); @@ -132,7 +131,6 @@ public class WebServiceTemplateBuilder { * @param detectHttpMessageSender if an HTTP-based {@link WebServiceMessageSender} * should be detected * @return a new builder instance - * @see HttpWebServiceMessageSenderBuilder */ public WebServiceTemplateBuilder detectHttpMessageSender(boolean detectHttpMessageSender) { return new WebServiceTemplateBuilder(this.httpMessageSenderFactory, detectHttpMessageSender, this.interceptors, diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java similarity index 100% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateCustomizer.java diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/package-info.java b/spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/package-info.java similarity index 100% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/webservices/client/package-info.java rename to spring-boot-project/spring-boot-webservices/src/main/java/org/springframework/boot/webservices/client/package-info.java diff --git a/spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 00000000000..8aab0bce5fe --- /dev/null +++ b/spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,9 @@ +{ + "properties": [ + { + "name": "spring.webservices.wsdl-locations", + "type": "java.util.List", + "description": "Comma-separated list of locations of WSDLs and accompanying XSDs to be exposed as beans." + } + ] +} diff --git a/spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000000..2ab305e059a --- /dev/null +++ b/spring-boot-project/spring-boot-webservices/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,2 @@ +org.springframework.boot.webservices.autoconfigure.WebServicesAutoConfiguration +org.springframework.boot.webservices.autoconfigure.client.WebServiceTemplateAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsConditionTests.java b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsConditionTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsConditionTests.java rename to spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsConditionTests.java index f5f750746ac..bf43067e596 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/OnWsdlLocationsConditionTests.java +++ b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/OnWsdlLocationsConditionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices; +package org.springframework.boot.webservices.autoconfigure; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfigurationTests.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java rename to spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfigurationTests.java index 1c195f56e16..75a5fd48b25 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices; +package org.springframework.boot.webservices.autoconfigure; import java.util.Collection; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesPropertiesTests.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java rename to spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesPropertiesTests.java index d88040807f9..16a13ca57af 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java +++ b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/WebServicesPropertiesTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices; +package org.springframework.boot.webservices.autoconfigure; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfigurationTests.java b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfigurationTests.java similarity index 90% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfigurationTests.java rename to spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfigurationTests.java index 5802e926f6b..8155ecbd274 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/webservices/client/WebServiceTemplateAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/autoconfigure/client/WebServiceTemplateAutoConfigurationTests.java @@ -14,15 +14,14 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.webservices.client; +package org.springframework.boot.webservices.autoconfigure.client; import java.util.function.Consumer; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration; -import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConfiguration; +import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder; import org.springframework.boot.test.context.assertj.AssertableApplicationContext; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ContextConsumer; @@ -48,8 +47,8 @@ import static org.assertj.core.api.Assertions.assertThat; */ class WebServiceTemplateAutoConfigurationTests { - private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration( - AutoConfigurations.of(WebServiceTemplateAutoConfiguration.class, HttpClientAutoConfiguration.class)); + private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() + .withConfiguration(AutoConfigurations.of(WebServiceTemplateAutoConfiguration.class)); @Test void autoConfiguredBuilderShouldNotHaveMarshallerAndUnmarshaller() { @@ -97,9 +96,8 @@ class WebServiceTemplateAutoConfigurationTests { } @Test - void whenHasFactoryProperty() { - this.contextRunner.withConfiguration(AutoConfigurations.of(HttpMessageConvertersAutoConfiguration.class)) - .withPropertyValues("spring.http.client.factory=simple") + void whenHasFactory() { + this.contextRunner.withBean(ClientHttpRequestFactoryBuilder.class, ClientHttpRequestFactoryBuilder::simple) .run(assertWebServiceTemplateBuilder((builder) -> { WebServiceTemplate webServiceTemplate = builder.build(); assertThat(webServiceTemplate.getMessageSenders()).hasSize(1); diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactoryTests.java b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactoryTests.java similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactoryTests.java rename to spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceMessageSenderFactoryTests.java diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java b/spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java rename to spring-boot-project/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java