Browse Source

Merge branch '4.0.x'

Closes gh-48843
pull/48876/head
Andy Wilkinson 3 weeks ago
parent
commit
d15ce76b7b
  1. 4
      module/spring-boot-resttestclient/build.gradle
  2. 1
      module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/AutoConfigureRestTestClient.java
  3. 6
      module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/RestTestClientTestAutoConfiguration.java
  4. 6
      module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/TestRestTemplateTestAutoConfiguration.java
  5. 2
      module/spring-boot-resttestclient/src/main/resources/META-INF/spring/org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient.imports
  6. 2
      module/spring-boot-resttestclient/src/main/resources/META-INF/spring/org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate.imports
  7. 8
      module/spring-boot-resttestclient/src/test/java/org/springframework/boot/resttestclient/autoconfigure/RestTestClientTestAutoConfigurationTests.java
  8. 8
      module/spring-boot-resttestclient/src/test/java/org/springframework/boot/resttestclient/autoconfigure/TestRestTemplateTestAutoConfigurationTests.java

4
module/spring-boot-resttestclient/build.gradle

@ -50,7 +50,7 @@ tasks.named("compileTestJava") {
tasks.named("checkAutoConfigurationClasses") { tasks.named("checkAutoConfigurationClasses") {
omittedFromImports = [ omittedFromImports = [
"org.springframework.boot.resttestclient.autoconfigure.RestTestClientAutoConfiguration", "org.springframework.boot.resttestclient.autoconfigure.RestTestClientTestAutoConfiguration",
"org.springframework.boot.resttestclient.autoconfigure.TestRestTemplateAutoConfiguration" "org.springframework.boot.resttestclient.autoconfigure.TestRestTemplateTestAutoConfiguration"
] ]
} }

1
module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/AutoConfigureRestTestClient.java

@ -31,7 +31,6 @@ import org.springframework.test.web.servlet.client.RestTestClient;
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 4.0.0 * @since 4.0.0
* @see RestTestClientAutoConfiguration
*/ */
@Target({ ElementType.TYPE, ElementType.METHOD }) @Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

6
module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/RestTestClientAutoConfiguration.java → module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/RestTestClientTestAutoConfiguration.java

@ -33,16 +33,16 @@ import org.springframework.web.client.RestClient;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
/** /**
* Auto-configuration for {@link RestTestClient}. * Test auto-configuration for {@link RestTestClient}.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Phillip Webb * @author Phillip Webb
* @since 4.0.0 * @see AutoConfigureRestTestClient
*/ */
@AutoConfiguration @AutoConfiguration
@ConditionalOnClass({ RestClient.class, RestTestClient.class, ClientHttpMessageConvertersCustomizer.class }) @ConditionalOnClass({ RestClient.class, RestTestClient.class, ClientHttpMessageConvertersCustomizer.class })
public final class RestTestClientAutoConfiguration { final class RestTestClientTestAutoConfiguration {
@Bean @Bean
SpringBootRestTestClientBuilderCustomizer springBootRestTestClientBuilderCustomizer( SpringBootRestTestClientBuilderCustomizer springBootRestTestClientBuilderCustomizer(

6
module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/TestRestTemplateAutoConfiguration.java → module/spring-boot-resttestclient/src/main/java/org/springframework/boot/resttestclient/autoconfigure/TestRestTemplateTestAutoConfiguration.java

@ -28,13 +28,13 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
/** /**
* Auto-configuration for {@link TestRestTemplate}. * Test auto-configuration for {@link TestRestTemplate}.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @since 4.0.0 * @see AutoConfigureTestRestTemplate
*/ */
@AutoConfiguration @AutoConfiguration
public final class TestRestTemplateAutoConfiguration { final class TestRestTemplateTestAutoConfiguration {
@Bean(name = "org.springframework.boot.resttestclient.TestRestTemplate") @Bean(name = "org.springframework.boot.resttestclient.TestRestTemplate")
@ConditionalOnMissingBean @ConditionalOnMissingBean

2
module/spring-boot-resttestclient/src/main/resources/META-INF/spring/org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient.imports

@ -1 +1 @@
org.springframework.boot.resttestclient.autoconfigure.RestTestClientAutoConfiguration org.springframework.boot.resttestclient.autoconfigure.RestTestClientTestAutoConfiguration

2
module/spring-boot-resttestclient/src/main/resources/META-INF/spring/org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate.imports

@ -1 +1 @@
org.springframework.boot.resttestclient.autoconfigure.TestRestTemplateAutoConfiguration org.springframework.boot.resttestclient.autoconfigure.TestRestTemplateTestAutoConfiguration

8
module/spring-boot-resttestclient/src/test/java/org/springframework/boot/resttestclient/autoconfigure/RestTestClientAutoConfigurationTests.java → module/spring-boot-resttestclient/src/test/java/org/springframework/boot/resttestclient/autoconfigure/RestTestClientTestAutoConfigurationTests.java

@ -43,15 +43,15 @@ import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link RestTestClientAutoConfiguration}. * Tests for {@link RestTestClientTestAutoConfiguration}.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Phillip Webb * @author Phillip Webb
*/ */
class RestTestClientAutoConfigurationTests { class RestTestClientTestAutoConfigurationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RestTestClientAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(RestTestClientTestAutoConfiguration.class));
@Test @Test
void registersRestTestClient() { void registersRestTestClient() {
@ -78,7 +78,7 @@ class RestTestClientAutoConfigurationTests {
@WithResource(name = "META-INF/spring.factories", @WithResource(name = "META-INF/spring.factories",
content = """ content = """
org.springframework.boot.test.http.server.LocalTestWebServer$Provider=\ org.springframework.boot.test.http.server.LocalTestWebServer$Provider=\
org.springframework.boot.resttestclient.autoconfigure.RestTestClientAutoConfigurationTests$TestLocalTestWebServerProvider org.springframework.boot.resttestclient.autoconfigure.RestTestClientTestAutoConfigurationTests$TestLocalTestWebServerProvider
""") """)
void shouldDefineRestTestClientBoundToWebServer() { void shouldDefineRestTestClientBoundToWebServer() {
this.contextRunner.run((context) -> { this.contextRunner.run((context) -> {

8
module/spring-boot-resttestclient/src/test/java/org/springframework/boot/resttestclient/autoconfigure/TestRestTemplateAutoConfigurationTests.java → module/spring-boot-resttestclient/src/test/java/org/springframework/boot/resttestclient/autoconfigure/TestRestTemplateTestAutoConfigurationTests.java

@ -31,14 +31,14 @@ import org.springframework.boot.testsupport.classpath.resources.WithResource;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link TestRestTemplateAutoConfiguration}. * Tests for {@link TestRestTemplateTestAutoConfiguration}.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
class TestRestTemplateAutoConfigurationTests { class TestRestTemplateTestAutoConfigurationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(TestRestTemplateAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(TestRestTemplateTestAutoConfiguration.class));
@Test @Test
void shouldFailTotRegisterTestRestTemplateWithoutWebServer() { void shouldFailTotRegisterTestRestTemplateWithoutWebServer() {
@ -51,7 +51,7 @@ class TestRestTemplateAutoConfigurationTests {
@WithResource(name = "META-INF/spring.factories", @WithResource(name = "META-INF/spring.factories",
content = """ content = """
org.springframework.boot.test.http.server.LocalTestWebServer$Provider=\ org.springframework.boot.test.http.server.LocalTestWebServer$Provider=\
org.springframework.boot.resttestclient.autoconfigure.TestRestTemplateAutoConfigurationTests$TestLocalTestWebServerProvider org.springframework.boot.resttestclient.autoconfigure.TestRestTemplateTestAutoConfigurationTests$TestLocalTestWebServerProvider
""") """)
void shouldDefineTestRestTemplateBoundToWebServer() { void shouldDefineTestRestTemplateBoundToWebServer() {
this.contextRunner.run((context) -> { this.contextRunner.run((context) -> {
Loading…
Cancel
Save