Create spring-boot-web-server-test module
This commit is contained in:
parent
88b0a7eeb4
commit
f685a5e9cb
|
@ -143,6 +143,7 @@ include "spring-boot-project:spring-boot-tx"
|
||||||
include "spring-boot-project:spring-boot-undertow"
|
include "spring-boot-project:spring-boot-undertow"
|
||||||
include "spring-boot-project:spring-boot-validation"
|
include "spring-boot-project:spring-boot-validation"
|
||||||
include "spring-boot-project:spring-boot-web-server"
|
include "spring-boot-project:spring-boot-web-server"
|
||||||
|
include "spring-boot-project:spring-boot-web-server-test"
|
||||||
include "spring-boot-project:spring-boot-webflux"
|
include "spring-boot-project:spring-boot-webflux"
|
||||||
include "spring-boot-project:spring-boot-webmvc"
|
include "spring-boot-project:spring-boot-webmvc"
|
||||||
include "spring-boot-project:spring-boot-webservices"
|
include "spring-boot-project:spring-boot-webservices"
|
||||||
|
|
|
@ -171,6 +171,7 @@ dependencies {
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-hateoas"))
|
testImplementation(project(":spring-boot-project:spring-boot-hateoas"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
|
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
|
||||||
testImplementation("io.micrometer:micrometer-observation-test")
|
testImplementation("io.micrometer:micrometer-observation-test")
|
||||||
testImplementation("io.opentelemetry:opentelemetry-exporter-common")
|
testImplementation("io.opentelemetry:opentelemetry-exporter-common")
|
||||||
|
|
|
@ -52,9 +52,9 @@ import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConf
|
||||||
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
|
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
|
||||||
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
|
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.springframework.boot.actuate.web.mappings.reactive.DispatcherHandlers
|
||||||
import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory;
|
import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
import org.springframework.boot.web.server.test.LocalServerPort;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
|
@ -33,8 +33,8 @@ import org.springframework.boot.actuate.web.mappings.servlet.FiltersMappingDescr
|
||||||
import org.springframework.boot.actuate.web.mappings.servlet.ServletsMappingDescriptionProvider;
|
import org.springframework.boot.actuate.web.mappings.servlet.ServletsMappingDescriptionProvider;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
|
||||||
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
|
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
|
||||||
|
import org.springframework.boot.web.server.test.LocalServerPort;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
|
@ -35,7 +35,6 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.web.server.WebServer;
|
import org.springframework.boot.web.server.WebServer;
|
||||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||||
import org.springframework.boot.web.server.context.WebServerApplicationContext;
|
import org.springframework.boot.web.server.context.WebServerApplicationContext;
|
||||||
|
@ -52,11 +51,13 @@ import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
import org.springframework.web.filter.ForwardedHeaderFilter;
|
import org.springframework.web.filter.ForwardedHeaderFilter;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for testing sub-classes of {@link ServletWebServerConfiguration}.
|
* Base class for testing sub-classes of {@link ServletWebServerConfiguration}.
|
||||||
|
@ -165,15 +166,15 @@ public abstract class AbstractServletWebServerAutoConfigurationTests {
|
||||||
WebServer webServer = ((WebServerApplicationContext) context.getSourceApplicationContext())
|
WebServer webServer = ((WebServerApplicationContext) context.getSourceApplicationContext())
|
||||||
.getWebServer();
|
.getWebServer();
|
||||||
int port = webServer.getPort();
|
int port = webServer.getPort();
|
||||||
TestRestTemplate rest = new TestRestTemplate();
|
RestTemplate rest = new RestTemplate();
|
||||||
RequestEntity<Void> request = RequestEntity.get("http://localhost:" + port)
|
RequestEntity<Void> request = RequestEntity.get("http://localhost:" + port)
|
||||||
.header("Upgrade", "websocket")
|
.header("Upgrade", "websocket")
|
||||||
.header("Connection", "upgrade")
|
.header("Connection", "upgrade")
|
||||||
.header("Sec-WebSocket-Version", "13")
|
.header("Sec-WebSocket-Version", "13")
|
||||||
.header("Sec-WebSocket-Key", "key")
|
.header("Sec-WebSocket-Key", "key")
|
||||||
.build();
|
.build();
|
||||||
ResponseEntity<Void> response = rest.exchange(request, Void.class);
|
assertThatExceptionOfType(HttpClientErrorException.Unauthorized.class)
|
||||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
|
.isThrownBy(() -> rest.exchange(request, Void.class));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2102,6 +2102,7 @@ bom {
|
||||||
"spring-boot-undertow",
|
"spring-boot-undertow",
|
||||||
"spring-boot-validation",
|
"spring-boot-validation",
|
||||||
"spring-boot-web-server",
|
"spring-boot-web-server",
|
||||||
|
"spring-boot-web-server-test",
|
||||||
"spring-boot-webflux",
|
"spring-boot-webflux",
|
||||||
"spring-boot-webmvc",
|
"spring-boot-webmvc",
|
||||||
"spring-boot-websocket"
|
"spring-boot-websocket"
|
||||||
|
|
|
@ -31,6 +31,7 @@ dependencies {
|
||||||
intTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all"))
|
intTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all"))
|
||||||
intTestImplementation(project(":spring-boot-project:spring-boot-test"))
|
intTestImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||||
|
intTestImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
intTestImplementation("org.apache.httpcomponents.client5:httpclient5")
|
intTestImplementation("org.apache.httpcomponents.client5:httpclient5")
|
||||||
intTestImplementation("net.bytebuddy:byte-buddy")
|
intTestImplementation("net.bytebuddy:byte-buddy")
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ import org.apache.hc.core5.util.TimeValue;
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ package org.springframework.boot.devtools.tests;
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
|
@ -216,9 +216,6 @@ dependencies {
|
||||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "configurationPropertiesMetadata"))
|
configurationProperties(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "configurationPropertiesMetadata"))
|
||||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-webservices", 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"))
|
|
||||||
|
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-actuator"))
|
implementation(project(path: ":spring-boot-project:spring-boot-actuator"))
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure"))
|
implementation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure"))
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-amqp"))
|
implementation(project(path: ":spring-boot-project:spring-boot-amqp"))
|
||||||
|
@ -248,6 +245,7 @@ dependencies {
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-cli"))
|
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-cli"))
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
|
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-undertow"))
|
||||||
|
implementation(project(path: ":spring-boot-project:spring-boot-web-server-test"))
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-webflux"))
|
implementation(project(path: ":spring-boot-project:spring-boot-webflux"))
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-webmvc"))
|
implementation(project(path: ":spring-boot-project:spring-boot-webmvc"))
|
||||||
implementation(project(path: ":spring-boot-project:spring-boot-webservices"))
|
implementation(project(path: ":spring-boot-project:spring-boot-webservices"))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2023 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -18,7 +18,7 @@ package org.springframework.boot.docs.howto.webserver.discoverport;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
import org.springframework.boot.web.server.test.LocalServerPort;
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||||
class MyWebIntegrationTests {
|
class MyWebIntegrationTests {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -23,7 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
|
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
import org.springframework.boot.web.server.test.LocalServerPort;
|
||||||
|
|
||||||
import static io.restassured.RestAssured.given;
|
import static io.restassured.RestAssured.given;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
package org.springframework.boot.docs.testing.springbootapplications.autoconfiguredspringrestdocs.withwebtestclient;
|
package org.springframework.boot.docs.testing.springbootapplications.autoconfiguredspringrestdocs.withwebtestclient;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.TestConfiguration;
|
import org.springframework.boot.test.context.TestConfiguration;
|
||||||
import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer;
|
import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
||||||
import static org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.document;
|
import static org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.document;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.context.TestConfiguration;
|
import org.springframework.boot.test.context.TestConfiguration;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ package org.springframework.boot.docs.testing.utilities.testresttemplate;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
|
@ -18,7 +18,7 @@ package org.springframework.boot.docs.howto.webserver.discoverport
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest
|
import org.springframework.boot.test.context.SpringBootTest
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort
|
import org.springframework.boot.web.server.test.LocalServerPort
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||||
class MyWebIntegrationTests {
|
class MyWebIntegrationTests {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -24,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs
|
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs
|
||||||
import org.springframework.boot.test.context.SpringBootTest
|
import org.springframework.boot.test.context.SpringBootTest
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort
|
import org.springframework.boot.web.server.test.LocalServerPort
|
||||||
import org.springframework.restdocs.restassured.RestAssuredRestDocumentation
|
import org.springframework.restdocs.restassured.RestAssuredRestDocumentation
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
package org.springframework.boot.docs.testing.springbootapplications.autoconfiguredspringrestdocs.withwebtestclient
|
package org.springframework.boot.docs.testing.springbootapplications.autoconfiguredspringrestdocs.withwebtestclient
|
||||||
|
|
||||||
import org.springframework.boot.test.context.TestConfiguration
|
import org.springframework.boot.test.context.TestConfiguration
|
||||||
import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer
|
import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation
|
import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient
|
import org.springframework.test.web.reactive.server.WebTestClient
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.boot.test.context.SpringBootTest
|
import org.springframework.boot.test.context.SpringBootTest
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate
|
import org.springframework.boot.web.server.test.client.TestRestTemplate
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||||
class MyRandomPortTestRestTemplateTests {
|
class MyRandomPortTestRestTemplateTests {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -22,7 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.boot.test.context.SpringBootTest
|
import org.springframework.boot.test.context.SpringBootTest
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
|
||||||
import org.springframework.boot.test.context.TestConfiguration
|
import org.springframework.boot.test.context.TestConfiguration
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate
|
import org.springframework.boot.web.server.test.client.TestRestTemplate
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder
|
import org.springframework.boot.web.client.RestTemplateBuilder
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -18,7 +18,7 @@ package org.springframework.boot.docs.testing.utilities.testresttemplate
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate
|
import org.springframework.boot.web.server.test.client.TestRestTemplate
|
||||||
|
|
||||||
class MyTests {
|
class MyTests {
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ dependencies {
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
testImplementation("jakarta.servlet:jakarta.servlet-api")
|
testImplementation("jakarta.servlet:jakarta.servlet-api")
|
||||||
|
|
||||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||||
|
|
|
@ -27,8 +27,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
|
@ -34,8 +34,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -34,8 +34,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -34,8 +34,8 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
|
||||||
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -34,8 +34,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -34,8 +34,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -33,8 +33,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -33,8 +33,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -35,8 +35,8 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
|
||||||
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -33,8 +33,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -18,10 +18,11 @@ dependencies {
|
||||||
optional("org.springframework:spring-webflux")
|
optional("org.springframework:spring-webflux")
|
||||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||||
|
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-reactor-netty"))
|
testImplementation(project(":spring-boot-project:spring-boot-reactor-netty"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
testImplementation("io.projectreactor:reactor-test")
|
testImplementation("io.projectreactor:reactor-test")
|
||||||
|
|
||||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||||
|
|
|
@ -32,9 +32,9 @@ import org.springframework.boot.mustache.servlet.view.MustacheView;
|
||||||
import org.springframework.boot.mustache.servlet.view.MustacheViewResolver;
|
import org.springframework.boot.mustache.servlet.view.MustacheViewResolver;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
|
||||||
import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext;
|
import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
|
@ -40,6 +40,7 @@ dependencies {
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
|
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
|
||||||
testImplementation("com.squareup.okhttp3:mockwebserver")
|
testImplementation("com.squareup.okhttp3:mockwebserver")
|
||||||
testImplementation("org.springframework.security:spring-security-oauth2-client")
|
testImplementation("org.springframework.security:spring-security-oauth2-client")
|
||||||
|
|
|
@ -34,10 +34,10 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||||
import org.springframework.boot.test.system.CapturedOutput;
|
import org.springframework.boot.test.system.CapturedOutput;
|
||||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||||
import org.springframework.boot.test.util.TestPropertyValues;
|
import org.springframework.boot.test.util.TestPropertyValues;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
|
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
|
||||||
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
|
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
|
||||||
import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext;
|
import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
|
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
|
||||||
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
|
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
|
@ -8,6 +8,7 @@ dependencies {
|
||||||
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
|
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
|
||||||
api(project(":spring-boot-project:spring-boot-test"))
|
api(project(":spring-boot-project:spring-boot-test"))
|
||||||
api(project(":spring-boot-project:spring-boot-test-autoconfigure"))
|
api(project(":spring-boot-project:spring-boot-test-autoconfigure"))
|
||||||
|
api(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
api("com.jayway.jsonpath:json-path")
|
api("com.jayway.jsonpath:json-path")
|
||||||
api("jakarta.xml.bind:jakarta.xml.bind-api")
|
api("jakarta.xml.bind:jakarta.xml.bind-api")
|
||||||
api("net.minidev:json-smart")
|
api("net.minidev:json-smart")
|
||||||
|
|
|
@ -69,6 +69,7 @@ dependencies {
|
||||||
optional(project(":spring-boot-project:spring-boot-security-oauth2-resource-server"))
|
optional(project(":spring-boot-project:spring-boot-security-oauth2-resource-server"))
|
||||||
optional(project(":spring-boot-project:spring-boot-tx"))
|
optional(project(":spring-boot-project:spring-boot-tx"))
|
||||||
optional(project(":spring-boot-project:spring-boot-validation"))
|
optional(project(":spring-boot-project:spring-boot-validation"))
|
||||||
|
optional(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
optional(project(":spring-boot-project:spring-boot-webflux"))
|
optional(project(":spring-boot-project:spring-boot-webflux"))
|
||||||
optional(project(":spring-boot-project:spring-boot-webmvc"))
|
optional(project(":spring-boot-project:spring-boot-webmvc"))
|
||||||
optional(project(":spring-boot-project:spring-boot-webservices"))
|
optional(project(":spring-boot-project:spring-boot-webservices"))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.restdocs;
|
package org.springframework.boot.test.autoconfigure.restdocs;
|
||||||
|
|
||||||
import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer;
|
import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer;
|
||||||
import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentationConfigurer;
|
import org.springframework.restdocs.webtestclient.WebTestClientRestDocumentationConfigurer;
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -20,8 +20,8 @@ import java.time.Duration;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer;
|
|
||||||
import org.springframework.boot.web.codec.CodecCustomizer;
|
import org.springframework.boot.web.codec.CodecCustomizer;
|
||||||
|
import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer;
|
||||||
import org.springframework.http.codec.ClientCodecConfigurer;
|
import org.springframework.http.codec.ClientCodecConfigurer;
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient.Builder;
|
import org.springframework.test.web.reactive.server.WebTestClient.Builder;
|
||||||
|
|
|
@ -25,8 +25,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer;
|
|
||||||
import org.springframework.boot.web.codec.CodecCustomizer;
|
import org.springframework.boot.web.codec.CodecCustomizer;
|
||||||
|
import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplicat
|
||||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration;
|
import org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration;
|
||||||
import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer;
|
import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer;
|
||||||
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath;
|
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath;
|
||||||
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
|
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
|
||||||
import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties;
|
import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.boot.test.web.htmlunit.LocalHostWebClient;
|
import org.springframework.boot.web.server.test.htmlunit.LocalHostWebClient;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.boot.test.web.htmlunit.webdriver.LocalHostWebConnectionHtmlUnitDriver;
|
import org.springframework.boot.web.server.test.htmlunit.webdriver.LocalHostWebConnectionHtmlUnitDriver;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.security.concurrent.DelegatingSecurityContextExecutor;
|
import org.springframework.security.concurrent.DelegatingSecurityContextExecutor;
|
||||||
|
|
|
@ -26,8 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.context.TestConfiguration;
|
import org.springframework.boot.test.context.TestConfiguration;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
|
||||||
import org.springframework.boot.testsupport.BuildOutput;
|
import org.springframework.boot.testsupport.BuildOutput;
|
||||||
|
import org.springframework.boot.web.server.test.LocalServerPort;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
|
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
|
||||||
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler;
|
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler;
|
||||||
|
|
|
@ -25,8 +25,8 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
|
||||||
import org.springframework.boot.testsupport.BuildOutput;
|
import org.springframework.boot.testsupport.BuildOutput;
|
||||||
|
import org.springframework.boot.web.server.test.LocalServerPort;
|
||||||
import org.springframework.util.FileSystemUtils;
|
import org.springframework.util.FileSystemUtils;
|
||||||
|
|
||||||
import static io.restassured.RestAssured.given;
|
import static io.restassured.RestAssured.given;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
import org.springframework.boot.test.context.FilteredClassLoader;
|
import org.springframework.boot.test.context.FilteredClassLoader;
|
||||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||||
import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer;
|
import org.springframework.boot.web.server.test.client.reactive.WebTestClientBuilderCustomizer;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||||
|
|
|
@ -5,9 +5,10 @@ plugins {
|
||||||
description = "Spring Boot Test Integration Tests"
|
description = "Spring Boot Test Integration Tests"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
|
||||||
testImplementation("org.springframework:spring-webflux")
|
testImplementation("org.springframework:spring-webflux")
|
||||||
testImplementation("org.springframework:spring-webmvc")
|
testImplementation("org.springframework:spring-webmvc")
|
||||||
testImplementation("org.springframework.graphql:spring-graphql-test")
|
testImplementation("org.springframework.graphql:spring-graphql-test")
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "dev.adamko.dokkatoo-html"
|
|
||||||
id "java-library"
|
id "java-library"
|
||||||
id "org.jetbrains.kotlin.jvm"
|
id "org.jetbrains.kotlin.jvm"
|
||||||
id "org.springframework.boot.deployed"
|
id "org.springframework.boot.deployed"
|
||||||
|
@ -24,16 +23,9 @@ dependencies {
|
||||||
optional("org.assertj:assertj-core")
|
optional("org.assertj:assertj-core")
|
||||||
optional("org.hamcrest:hamcrest-core")
|
optional("org.hamcrest:hamcrest-core")
|
||||||
optional("org.hamcrest:hamcrest-library")
|
optional("org.hamcrest:hamcrest-library")
|
||||||
optional("org.htmlunit:htmlunit")
|
|
||||||
optional("org.jetbrains.kotlin:kotlin-stdlib")
|
|
||||||
optional("org.jetbrains.kotlin:kotlin-reflect")
|
|
||||||
optional("org.junit.jupiter:junit-jupiter-api")
|
optional("org.junit.jupiter:junit-jupiter-api")
|
||||||
optional("org.mockito:mockito-core")
|
optional("org.mockito:mockito-core")
|
||||||
optional("org.skyscreamer:jsonassert")
|
optional("org.skyscreamer:jsonassert")
|
||||||
optional("org.seleniumhq.selenium:htmlunit3-driver") {
|
|
||||||
exclude(group: "com.sun.activation", module: "jakarta.activation")
|
|
||||||
}
|
|
||||||
optional("org.seleniumhq.selenium:selenium-api")
|
|
||||||
optional("org.springframework:spring-web")
|
optional("org.springframework:spring-web")
|
||||||
optional("org.springframework:spring-webflux")
|
optional("org.springframework:spring-webflux")
|
||||||
optional("org.springframework.graphql:spring-graphql-test")
|
optional("org.springframework.graphql:spring-graphql-test")
|
||||||
|
@ -45,6 +37,8 @@ dependencies {
|
||||||
testImplementation("org.apache.groovy:groovy")
|
testImplementation("org.apache.groovy:groovy")
|
||||||
testImplementation("org.apache.groovy:groovy-xml")
|
testImplementation("org.apache.groovy:groovy-xml")
|
||||||
testImplementation("org.eclipse:yasson")
|
testImplementation("org.eclipse:yasson")
|
||||||
|
testImplementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||||
|
testImplementation("org.jetbrains.kotlin:kotlin-stdlib")
|
||||||
testImplementation("org.slf4j:slf4j-api")
|
testImplementation("org.slf4j:slf4j-api")
|
||||||
testImplementation("org.spockframework:spock-core")
|
testImplementation("org.spockframework:spock-core")
|
||||||
testImplementation("org.springframework:spring-webmvc")
|
testImplementation("org.springframework:spring-webmvc")
|
||||||
|
|
|
@ -29,7 +29,6 @@ import org.springframework.boot.ApplicationArguments;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.SpringBootConfiguration;
|
import org.springframework.boot.SpringBootConfiguration;
|
||||||
import org.springframework.boot.WebApplicationType;
|
import org.springframework.boot.WebApplicationType;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
|
||||||
import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext;
|
import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@ -60,11 +59,7 @@ import org.springframework.web.context.WebApplicationContext;
|
||||||
* <li>Provides support for different {@link #webEnvironment() webEnvironment} modes,
|
* <li>Provides support for different {@link #webEnvironment() webEnvironment} modes,
|
||||||
* including the ability to start a fully running web server listening on a
|
* including the ability to start a fully running web server listening on a
|
||||||
* {@link WebEnvironment#DEFINED_PORT defined} or {@link WebEnvironment#RANDOM_PORT
|
* {@link WebEnvironment#DEFINED_PORT defined} or {@link WebEnvironment#RANDOM_PORT
|
||||||
* random} port.</li>
|
* random} port when {@code spring-boot-web-server-test} is on the classpath.</li>
|
||||||
* <li>Registers a {@link org.springframework.boot.test.web.client.TestRestTemplate
|
|
||||||
* TestRestTemplate} and/or
|
|
||||||
* {@link org.springframework.test.web.reactive.server.WebTestClient WebTestClient} bean
|
|
||||||
* for use in web tests that are using a fully running web server.</li>
|
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
|
@ -148,14 +143,16 @@ public @interface SpringBootTest {
|
||||||
/**
|
/**
|
||||||
* Creates a web application context (reactive or servlet based) and sets a
|
* Creates a web application context (reactive or servlet based) and sets a
|
||||||
* {@code server.port=0} {@link Environment} property (which usually triggers
|
* {@code server.port=0} {@link Environment} property (which usually triggers
|
||||||
* listening on a random port). Often used in conjunction with a
|
* listening on a random port). Requires a dependency on
|
||||||
* {@link LocalServerPort @LocalServerPort} injected field on the test.
|
* {@code spring-boot-web-server-test}. Often used in conjunction with a
|
||||||
|
* {@code @LocalServerPort} injected field on the test.
|
||||||
*/
|
*/
|
||||||
RANDOM_PORT(true),
|
RANDOM_PORT(true),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a web application context (reactive or servlet based) without defining
|
* Creates a web application context (reactive or servlet based) without defining
|
||||||
* any {@code server.port=0} {@link Environment} property.
|
* any {@code server.port=0} {@link Environment} property. Requires a dependency
|
||||||
|
* on {@code spring-boot-web-server-test}.
|
||||||
*/
|
*/
|
||||||
DEFINED_PORT(true),
|
DEFINED_PORT(true),
|
||||||
|
|
||||||
|
|
|
@ -4,20 +4,13 @@ org.springframework.boot.test.context.ImportsContextCustomizerFactory,\
|
||||||
org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizerFactory,\
|
org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizerFactory,\
|
||||||
org.springframework.boot.test.graphql.tester.HttpGraphQlTesterContextCustomizerFactory,\
|
org.springframework.boot.test.graphql.tester.HttpGraphQlTesterContextCustomizerFactory,\
|
||||||
org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory,\
|
org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory,\
|
||||||
org.springframework.boot.test.mock.mockito.MockitoContextCustomizerFactory,\
|
org.springframework.boot.test.mock.mockito.MockitoContextCustomizerFactory
|
||||||
org.springframework.boot.test.web.client.TestRestTemplateContextCustomizerFactory,\
|
|
||||||
org.springframework.boot.test.web.reactive.server.WebTestClientContextCustomizerFactory,\
|
|
||||||
org.springframework.boot.test.web.reactor.netty.DisableReactorResourceFactoryGlobalResourcesContextCustomizerFactory
|
|
||||||
|
|
||||||
# Test Execution Listeners
|
# Test Execution Listeners
|
||||||
org.springframework.test.context.TestExecutionListener=\
|
org.springframework.test.context.TestExecutionListener=\
|
||||||
org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener,\
|
org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener,\
|
||||||
org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener
|
org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener
|
||||||
|
|
||||||
# Environment Post Processors
|
|
||||||
org.springframework.boot.env.EnvironmentPostProcessor=\
|
|
||||||
org.springframework.boot.test.web.SpringBootTestRandomPortEnvironmentPostProcessor
|
|
||||||
|
|
||||||
# Application Context Initializers
|
# Application Context Initializers
|
||||||
org.springframework.context.ApplicationContextInitializer=\
|
org.springframework.context.ApplicationContextInitializer=\
|
||||||
org.springframework.boot.test.context.filter.ExcludeFilterApplicationContextInitializer
|
org.springframework.boot.test.context.filter.ExcludeFilterApplicationContextInitializer
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
plugins {
|
||||||
|
id "dev.adamko.dokkatoo-html"
|
||||||
|
id "java-library"
|
||||||
|
id "org.jetbrains.kotlin.jvm"
|
||||||
|
id "org.springframework.boot.deployed"
|
||||||
|
id "org.springframework.boot.optional-dependencies"
|
||||||
|
}
|
||||||
|
|
||||||
|
description = "Spring Boot Web Server Test"
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api(project(":spring-boot-project:spring-boot"))
|
||||||
|
|
||||||
|
implementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
|
|
||||||
|
optional(project(":spring-boot-project:spring-boot-web-server"))
|
||||||
|
optional("jakarta.servlet:jakarta.servlet-api")
|
||||||
|
optional("org.apache.httpcomponents.client5:httpclient5")
|
||||||
|
optional("org.jetbrains.kotlin:kotlin-reflect")
|
||||||
|
optional("org.jetbrains.kotlin:kotlin-stdlib")
|
||||||
|
optional("org.springframework:spring-test")
|
||||||
|
optional("org.springframework:spring-web")
|
||||||
|
optional("org.springframework:spring-webflux")
|
||||||
|
optional("org.htmlunit:htmlunit")
|
||||||
|
optional("org.seleniumhq.selenium:htmlunit3-driver") {
|
||||||
|
exclude(group: "com.sun.activation", module: "jakarta.activation")
|
||||||
|
}
|
||||||
|
optional("org.seleniumhq.selenium:selenium-api")
|
||||||
|
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
||||||
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||||
|
testImplementation("io.mockk:mockk")
|
||||||
|
testImplementation("io.projectreactor.netty:reactor-netty-http")
|
||||||
|
testImplementation("org.springframework:spring-webmvc")
|
||||||
|
|
||||||
|
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.server;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -30,7 +30,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
* <code>@Value("${local.management.port}")</code>.
|
* <code>@Value("${local.management.port}")</code>.
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
* @since 2.7.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
|
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.server;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -31,7 +31,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
*
|
*
|
||||||
* @author Anand Shah
|
* @author Anand Shah
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
* @since 2.7.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
|
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2023 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import org.springframework.boot.web.client.RootUriTemplateHandler;
|
import org.springframework.boot.web.client.RootUriTemplateHandler;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
|
@ -30,7 +30,7 @@ import org.springframework.web.util.UriTemplateHandler;
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
* @author Madhura Bhave
|
* @author Madhura Bhave
|
||||||
* @since 1.4.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
public class LocalHostUriTemplateHandler extends RootUriTemplateHandler {
|
public class LocalHostUriTemplateHandler extends RootUriTemplateHandler {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.security.KeyManagementException;
|
import java.security.KeyManagementException;
|
||||||
|
@ -86,11 +86,10 @@ import org.springframework.web.util.UriTemplateHandler;
|
||||||
* {@link RestTemplate}. If you need access to the underlying {@link RestTemplate} use
|
* {@link RestTemplate}. If you need access to the underlying {@link RestTemplate} use
|
||||||
* {@link #getRestTemplate()}.
|
* {@link #getRestTemplate()}.
|
||||||
* <p>
|
* <p>
|
||||||
* If you are using the
|
* If you are using the {@code @SpringBootTest} annotation with an embedded server, a
|
||||||
* {@link org.springframework.boot.test.context.SpringBootTest @SpringBootTest} annotation
|
* {@link TestRestTemplate} is automatically available and can be {@code @Autowired} into
|
||||||
* with an embedded server, a {@link TestRestTemplate} is automatically available and can
|
* your test. If you need customizations (for example to adding additional message
|
||||||
* be {@code @Autowired} into your test. If you need customizations (for example to adding
|
* converters) use a {@link RestTemplateBuilder} {@code @Bean}.
|
||||||
* additional message converters) use a {@link RestTemplateBuilder} {@code @Bean}.
|
|
||||||
*
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
|
@ -98,7 +97,7 @@ import org.springframework.web.util.UriTemplateHandler;
|
||||||
* @author Kristine Jetzke
|
* @author Kristine Jetzke
|
||||||
* @author Dmytro Nosan
|
* @author Dmytro Nosan
|
||||||
* @author Yanming Zhou
|
* @author Yanming Zhou
|
||||||
* @since 1.4.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
public class TestRestTemplate {
|
public class TestRestTemplate {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import org.springframework.aot.AotDetector;
|
import org.springframework.aot.AotDetector;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
|
@ -30,9 +30,9 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||||
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
|
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
|
||||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption;
|
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory;
|
import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate.HttpClientOption;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.ApplicationContextAware;
|
import org.springframework.context.ApplicationContextAware;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -15,6 +15,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Web test utilities and support classes.
|
* Client-side support for testing embedded web servers.
|
||||||
*/
|
*/
|
||||||
package org.springframework.boot.test.web;
|
package org.springframework.boot.web.server.test.client;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.reactive.server;
|
package org.springframework.boot.web.server.test.client.reactive;
|
||||||
|
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient.Builder;
|
import org.springframework.test.web.reactive.server.WebTestClient.Builder;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import org.springframework.test.web.reactive.server.WebTestClient.Builder;
|
||||||
* auto-configured {@link Builder}.
|
* auto-configured {@link Builder}.
|
||||||
*
|
*
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
* @since 2.2.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface WebTestClientBuilderCustomizer {
|
public interface WebTestClientBuilderCustomizer {
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.reactive.server;
|
package org.springframework.boot.web.server.test.client.reactive;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2023 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.reactive.server;
|
package org.springframework.boot.web.server.test.client.reactive;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -18,4 +18,4 @@
|
||||||
* Spring Boot support for testing Spring WebFlux server endpoints via
|
* Spring Boot support for testing Spring WebFlux server endpoints via
|
||||||
* {@link org.springframework.test.web.reactive.server.WebTestClient}.
|
* {@link org.springframework.test.web.reactive.server.WebTestClient}.
|
||||||
*/
|
*/
|
||||||
package org.springframework.boot.test.web.reactive.server;
|
package org.springframework.boot.web.server.test.client.reactive;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.htmlunit;
|
package org.springframework.boot.web.server.test.htmlunit;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
||||||
* <code>localhost:${local.server.port}</code>.
|
* <code>localhost:${local.server.port}</code>.
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @since 1.4.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
public class LocalHostWebClient extends WebClient {
|
public class LocalHostWebClient extends WebClient {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -17,4 +17,4 @@
|
||||||
/**
|
/**
|
||||||
* HtmlUnit support classes.
|
* HtmlUnit support classes.
|
||||||
*/
|
*/
|
||||||
package org.springframework.boot.test.web.htmlunit;
|
package org.springframework.boot.web.server.test.htmlunit;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.htmlunit.webdriver;
|
package org.springframework.boot.web.server.test.htmlunit.webdriver;
|
||||||
|
|
||||||
import org.htmlunit.BrowserVersion;
|
import org.htmlunit.BrowserVersion;
|
||||||
import org.openqa.selenium.Capabilities;
|
import org.openqa.selenium.Capabilities;
|
||||||
|
@ -28,7 +28,7 @@ import org.springframework.util.Assert;
|
||||||
* with <code>localhost:${local.server.port}</code>.
|
* with <code>localhost:${local.server.port}</code>.
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @since 1.4.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
public class LocalHostWebConnectionHtmlUnitDriver extends WebConnectionHtmlUnitDriver {
|
public class LocalHostWebConnectionHtmlUnitDriver extends WebConnectionHtmlUnitDriver {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -17,4 +17,4 @@
|
||||||
/**
|
/**
|
||||||
* Selenium support classes.
|
* Selenium support classes.
|
||||||
*/
|
*/
|
||||||
package org.springframework.boot.test.web.htmlunit.webdriver;
|
package org.springframework.boot.web.server.test.htmlunit.webdriver;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -17,4 +17,4 @@
|
||||||
/**
|
/**
|
||||||
* Web server test utilities and support classes.
|
* Web server test utilities and support classes.
|
||||||
*/
|
*/
|
||||||
package org.springframework.boot.test.web.server;
|
package org.springframework.boot.web.server.test;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.reactor.netty;
|
package org.springframework.boot.web.server.test.reactor.netty;
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.reactor.netty;
|
package org.springframework.boot.web.server.test.reactor.netty;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -17,4 +17,4 @@
|
||||||
/**
|
/**
|
||||||
* Spring Boot support for testing Reactor Netty.
|
* Spring Boot support for testing Reactor Netty.
|
||||||
*/
|
*/
|
||||||
package org.springframework.boot.test.web.reactor.netty;
|
package org.springframework.boot.web.server.test.reactor.netty;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2017 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client
|
package org.springframework.boot.web.server.test.client
|
||||||
|
|
||||||
import org.springframework.core.ParameterizedTypeReference
|
import org.springframework.core.ParameterizedTypeReference
|
||||||
import org.springframework.http.HttpEntity
|
import org.springframework.http.HttpEntity
|
||||||
|
@ -31,7 +31,7 @@ import java.net.URI
|
||||||
* generic type arguments.
|
* generic type arguments.
|
||||||
*
|
*
|
||||||
* @author Sebastien Deleuze
|
* @author Sebastien Deleuze
|
||||||
* @since 2.0.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
@Throws(RestClientException::class)
|
@Throws(RestClientException::class)
|
||||||
inline fun <reified T : Any> TestRestTemplate.getForObject(url: String, vararg uriVariables: Any): T? =
|
inline fun <reified T : Any> TestRestTemplate.getForObject(url: String, vararg uriVariables: Any): T? =
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"groups": [],
|
||||||
|
"properties": []
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Environment Post Processors
|
||||||
|
org.springframework.boot.env.EnvironmentPostProcessor=\
|
||||||
|
org.springframework.boot.web.server.test.SpringBootTestRandomPortEnvironmentPostProcessor
|
||||||
|
|
||||||
|
# Spring Test Context Customizer Factories
|
||||||
|
org.springframework.test.context.ContextCustomizerFactory=\
|
||||||
|
org.springframework.boot.web.server.test.client.TestRestTemplateContextCustomizerFactory,\
|
||||||
|
org.springframework.boot.web.server.test.client.reactive.WebTestClientContextCustomizerFactory,\
|
||||||
|
org.springframework.boot.web.server.test.reactor.netty.DisableReactorResourceFactoryGlobalResourcesContextCustomizerFactory
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
||||||
|
@ -23,11 +23,11 @@ import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
|
||||||
import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory;
|
import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory;
|
||||||
import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext;
|
import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext;
|
||||||
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
|
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
|
@ -14,17 +14,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import jakarta.servlet.ServletContext;
|
import jakarta.servlet.ServletContext;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
|
||||||
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
|
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
|
||||||
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
|
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.server;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.server;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2024 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,8 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.test.annotation.DirtiesContext;
|
import org.springframework.test.annotation.DirtiesContext;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,8 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.test.annotation.DirtiesContext;
|
import org.springframework.test.annotation.DirtiesContext;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,10 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,10 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,15 +14,16 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.AbstractSpringBootTestWebServerWebEnvironmentTests.AbstractConfig;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.context.SpringBootTestWebEnvironmentContextHierarchyTests.ChildConfiguration;
|
import org.springframework.boot.web.server.test.AbstractSpringBootTestWebServerWebEnvironmentTests.AbstractConfig;
|
||||||
import org.springframework.boot.test.context.SpringBootTestWebEnvironmentContextHierarchyTests.ParentConfiguration;
|
import org.springframework.boot.web.server.test.SpringBootTestWebEnvironmentContextHierarchyTests.ChildConfiguration;
|
||||||
|
import org.springframework.boot.web.server.test.SpringBootTestWebEnvironmentContextHierarchyTests.ParentConfiguration;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.test.annotation.DirtiesContext;
|
import org.springframework.test.annotation.DirtiesContext;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,8 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.test.annotation.DirtiesContext;
|
import org.springframework.test.annotation.DirtiesContext;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,13 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.AbstractSpringBootTestWebServerWebEnvironmentTests.AbstractConfig;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
|
import org.springframework.boot.web.server.test.AbstractSpringBootTestWebServerWebEnvironmentTests.AbstractConfig;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.test.annotation.DirtiesContext;
|
import org.springframework.test.annotation.DirtiesContext;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2023 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,10 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.context;
|
package org.springframework.boot.web.server.test;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import org.springframework.beans.factory.BeanFactory;
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
import org.springframework.beans.factory.BeanFactoryAware;
|
import org.springframework.beans.factory.BeanFactoryAware;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer.TestRestTemplateRegistrar;
|
import org.springframework.boot.web.server.test.client.TestRestTemplateContextCustomizer.TestRestTemplateRegistrar;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.support.AbstractApplicationContext;
|
import org.springframework.context.support.AbstractApplicationContext;
|
||||||
import org.springframework.test.context.MergedContextConfiguration;
|
import org.springframework.test.context.MergedContextConfiguration;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.client;
|
package org.springframework.boot.web.server.test.client;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
@ -35,8 +35,8 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
|
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
|
||||||
import org.springframework.boot.http.client.ClientHttpRequestFactorySettings;
|
import org.springframework.boot.http.client.ClientHttpRequestFactorySettings;
|
||||||
import org.springframework.boot.http.client.HttpRedirects;
|
import org.springframework.boot.http.client.HttpRedirects;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate.HttpClientOption;
|
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
|
import org.springframework.boot.web.server.test.client.TestRestTemplate.HttpClientOption;
|
||||||
import org.springframework.core.ParameterizedTypeReference;
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2023 the original author or authors.
|
* Copyright 2012-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.reactive.server;
|
package org.springframework.boot.web.server.test.client.reactive;
|
||||||
|
|
||||||
import org.springframework.beans.factory.BeanFactory;
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
import org.springframework.beans.factory.BeanFactoryAware;
|
import org.springframework.beans.factory.BeanFactoryAware;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.test.web.reactive.server;
|
package org.springframework.boot.web.server.test.client.reactive;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue