Use Gradle test fixture support for spring-web
See gh-23550
This commit is contained in:
parent
8a371c7669
commit
7b6d83a106
|
@ -78,11 +78,11 @@ public class TestSourcesPlugin implements Plugin<Project> {
|
||||||
"spring-orm",
|
"spring-orm",
|
||||||
"spring-oxm",
|
"spring-oxm",
|
||||||
// "spring-test",
|
// "spring-test",
|
||||||
"spring-tx"
|
"spring-tx",
|
||||||
// "spring-web",
|
"spring-web",
|
||||||
// "spring-webflux",
|
"spring-webflux",
|
||||||
// "spring-webmvc",
|
// "spring-webmvc",
|
||||||
// "spring-websocket"
|
"spring-websocket"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ dependencies {
|
||||||
testCompile(testFixtures(project(":spring-beans")))
|
testCompile(testFixtures(project(":spring-beans")))
|
||||||
testCompile(testFixtures(project(":spring-context")))
|
testCompile(testFixtures(project(":spring-context")))
|
||||||
testCompile(testFixtures(project(":spring-core")))
|
testCompile(testFixtures(project(":spring-core")))
|
||||||
|
testCompile(testFixtures(project(":spring-web")))
|
||||||
testCompile("org.aspectj:aspectjweaver")
|
testCompile("org.aspectj:aspectjweaver")
|
||||||
testCompile("org.hsqldb:hsqldb")
|
testCompile("org.hsqldb:hsqldb")
|
||||||
testRuntime("javax.xml.bind:jaxb-api")
|
testRuntime("javax.xml.bind:jaxb-api")
|
||||||
|
|
|
@ -34,12 +34,6 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||||
import org.springframework.mock.web.test.MockAsyncContext;
|
|
||||||
import org.springframework.mock.web.test.MockFilterConfig;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.mock.web.test.PassThroughFilterChain;
|
|
||||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
|
@ -48,6 +42,12 @@ import org.springframework.web.context.request.async.StandardServletAsyncWebRequ
|
||||||
import org.springframework.web.context.request.async.WebAsyncManager;
|
import org.springframework.web.context.request.async.WebAsyncManager;
|
||||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockAsyncContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockFilterConfig;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.PassThroughFilterChain;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
|
|
|
@ -46,6 +46,7 @@ dependencies {
|
||||||
testCompile(testFixtures(project(":spring-context")))
|
testCompile(testFixtures(project(":spring-context")))
|
||||||
testCompile(testFixtures(project(":spring-core")))
|
testCompile(testFixtures(project(":spring-core")))
|
||||||
testCompile(testFixtures(project(":spring-tx")))
|
testCompile(testFixtures(project(":spring-tx")))
|
||||||
|
testCompile(testFixtures(project(":spring-web")))
|
||||||
testCompile("javax.annotation:javax.annotation-api")
|
testCompile("javax.annotation:javax.annotation-api")
|
||||||
testCompile("javax.cache:cache-api")
|
testCompile("javax.cache:cache-api")
|
||||||
testCompile("javax.ejb:javax.ejb-api")
|
testCompile("javax.ejb:javax.ejb-api")
|
||||||
|
|
|
@ -21,10 +21,10 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.server.reactive.HttpHandler;
|
import org.springframework.http.server.reactive.HttpHandler;
|
||||||
import org.springframework.http.server.reactive.bootstrap.ReactorHttpServer;
|
|
||||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||||
import org.springframework.web.reactive.function.server.RouterFunctions;
|
import org.springframework.web.reactive.function.server.RouterFunctions;
|
||||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.ReactorHttpServer;
|
||||||
|
|
||||||
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
|
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
|
||||||
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
|
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
|
||||||
|
|
|
@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.impl.UnknownSerializer;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.converter.json.SpringHandlerInstantiator;
|
import org.springframework.http.converter.json.SpringHandlerInstantiator;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
|
|
|
@ -77,4 +77,10 @@ dependencies {
|
||||||
testRuntime("com.sun.xml.bind:jaxb-impl")
|
testRuntime("com.sun.xml.bind:jaxb-impl")
|
||||||
testRuntime("javax.json:javax.json-api")
|
testRuntime("javax.json:javax.json-api")
|
||||||
testRuntime("org.apache.johnzon:johnzon-jsonb")
|
testRuntime("org.apache.johnzon:johnzon-jsonb")
|
||||||
|
testFixturesApi("javax.servlet:javax.servlet-api")
|
||||||
|
testFixturesApi("org.junit.jupiter:junit-jupiter-api")
|
||||||
|
testFixturesApi("org.junit.jupiter:junit-jupiter-params")
|
||||||
|
testFixturesImplementation("io.projectreactor:reactor-test")
|
||||||
|
testFixturesImplementation("org.apache.taglibs:taglibs-standard-jstlel")
|
||||||
|
testFixturesImplementation("org.assertj:assertj-core")
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ import org.springframework.http.codec.xml.Jaxb2XmlEncoder;
|
||||||
import org.springframework.protobuf.Msg;
|
import org.springframework.protobuf.Msg;
|
||||||
import org.springframework.protobuf.SecondMsg;
|
import org.springframework.protobuf.SecondMsg;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test scenarios for data buffer leaks.
|
* Test scenarios for data buffer leaks.
|
||||||
|
|
|
@ -37,10 +37,10 @@ import org.springframework.core.codec.CharSequenceEncoder;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
import org.springframework.util.MimeTypeUtils;
|
import org.springframework.util.MimeTypeUtils;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
|
||||||
import static java.nio.charset.StandardCharsets.ISO_8859_1;
|
import static java.nio.charset.StandardCharsets.ISO_8859_1;
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
|
@ -32,9 +32,9 @@ import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,9 @@ import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
||||||
import org.springframework.core.testfixture.io.buffer.DataBufferTestUtils;
|
import org.springframework.core.testfixture.io.buffer.DataBufferTestUtils;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,14 @@ import org.springframework.core.io.Resource;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpRange;
|
import org.springframework.http.HttpRange;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
|
||||||
import org.springframework.util.MimeTypeUtils;
|
import org.springframework.util.MimeTypeUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.http.MediaType.TEXT_PLAIN;
|
import static org.springframework.http.MediaType.TEXT_PLAIN;
|
||||||
import static org.springframework.mock.http.server.reactive.test.MockServerHttpRequest.get;
|
import static org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest.get;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for {@link ResourceHttpMessageWriter}.
|
* Unit tests for {@link ResourceHttpMessageWriter}.
|
||||||
|
|
|
@ -30,7 +30,8 @@ import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.json.Jackson2JsonDecoder;
|
import org.springframework.http.codec.json.Jackson2JsonDecoder;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,8 @@ import org.springframework.core.testfixture.io.buffer.DataBufferTestUtils;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.json.Jackson2JsonEncoder;
|
import org.springframework.http.codec.json.Jackson2JsonEncoder;
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.core.ResolvableType.forClass;
|
import static org.springframework.core.ResolvableType.forClass;
|
||||||
|
|
|
@ -27,9 +27,9 @@ import reactor.core.publisher.Flux;
|
||||||
import org.springframework.core.ResolvableType;
|
import org.springframework.core.ResolvableType;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.codec.AbstractDecoderTests;
|
import org.springframework.core.testfixture.codec.AbstractDecoderTests;
|
||||||
import org.springframework.http.codec.Pojo;
|
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -28,10 +28,10 @@ import org.springframework.core.ResolvableType;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
||||||
import org.springframework.core.testfixture.io.buffer.DataBufferTestUtils;
|
import org.springframework.core.testfixture.io.buffer.DataBufferTestUtils;
|
||||||
import org.springframework.http.codec.Pojo;
|
|
||||||
import org.springframework.http.codec.ServerSentEvent;
|
import org.springframework.http.codec.ServerSentEvent;
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -39,10 +39,10 @@ import org.springframework.core.codec.DecodingException;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.codec.AbstractDecoderTests;
|
import org.springframework.core.testfixture.codec.AbstractDecoderTests;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.Pojo;
|
|
||||||
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView1;
|
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView1;
|
||||||
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView3;
|
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView3;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static java.util.Arrays.asList;
|
import static java.util.Arrays.asList;
|
||||||
import static java.util.Collections.emptyMap;
|
import static java.util.Collections.emptyMap;
|
||||||
|
|
|
@ -36,12 +36,12 @@ import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.io.buffer.DataBufferUtils;
|
import org.springframework.core.io.buffer.DataBufferUtils;
|
||||||
import org.springframework.core.testfixture.codec.AbstractEncoderTests;
|
import org.springframework.core.testfixture.codec.AbstractEncoderTests;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.Pojo;
|
|
||||||
import org.springframework.http.codec.ServerSentEvent;
|
import org.springframework.http.codec.ServerSentEvent;
|
||||||
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView1;
|
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView1;
|
||||||
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView3;
|
import org.springframework.http.codec.json.JacksonViewBean.MyJacksonView3;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
import org.springframework.util.MimeTypeUtils;
|
import org.springframework.util.MimeTypeUtils;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static java.util.Collections.singletonMap;
|
import static java.util.Collections.singletonMap;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
|
@ -27,9 +27,9 @@ import reactor.core.publisher.Flux;
|
||||||
import org.springframework.core.ResolvableType;
|
import org.springframework.core.ResolvableType;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.codec.AbstractDecoderTests;
|
import org.springframework.core.testfixture.codec.AbstractDecoderTests;
|
||||||
import org.springframework.http.codec.Pojo;
|
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.core.ResolvableType.forClass;
|
import static org.springframework.core.ResolvableType.forClass;
|
||||||
|
|
|
@ -31,10 +31,10 @@ import org.springframework.core.ResolvableType;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.codec.AbstractEncoderTests;
|
import org.springframework.core.testfixture.codec.AbstractEncoderTests;
|
||||||
import org.springframework.core.testfixture.io.buffer.DataBufferTestUtils;
|
import org.springframework.core.testfixture.io.buffer.DataBufferTestUtils;
|
||||||
import org.springframework.http.codec.Pojo;
|
|
||||||
import org.springframework.http.codec.ServerSentEvent;
|
import org.springframework.http.codec.ServerSentEvent;
|
||||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
import org.springframework.util.MimeType;
|
import org.springframework.util.MimeType;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.core.io.buffer.DataBufferUtils.release;
|
import static org.springframework.core.io.buffer.DataBufferUtils.release;
|
||||||
|
|
|
@ -40,9 +40,9 @@ import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.client.MultipartBodyBuilder;
|
import org.springframework.http.client.MultipartBodyBuilder;
|
||||||
import org.springframework.http.codec.ClientCodecConfigurer;
|
import org.springframework.http.codec.ClientCodecConfigurer;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
|
|
|
@ -42,9 +42,9 @@ import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.client.MultipartBodyBuilder;
|
import org.springframework.http.client.MultipartBodyBuilder;
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
import org.springframework.mock.http.client.reactive.test.MockClientHttpRequest;
|
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.testfixture.http.client.reactive.MockClientHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
|
||||||
import static java.util.Collections.emptyMap;
|
import static java.util.Collections.emptyMap;
|
||||||
import static java.util.Collections.singletonMap;
|
import static java.util.Collections.singletonMap;
|
||||||
|
|
|
@ -32,13 +32,13 @@ import org.springframework.core.ResolvableType;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
import org.springframework.core.testfixture.io.buffer.AbstractLeakCheckingTests;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.Pojo;
|
|
||||||
import org.springframework.http.codec.xml.jaxb.XmlRootElement;
|
import org.springframework.http.codec.xml.jaxb.XmlRootElement;
|
||||||
import org.springframework.http.codec.xml.jaxb.XmlRootElementWithName;
|
import org.springframework.http.codec.xml.jaxb.XmlRootElementWithName;
|
||||||
import org.springframework.http.codec.xml.jaxb.XmlRootElementWithNameAndNamespace;
|
import org.springframework.http.codec.xml.jaxb.XmlRootElementWithNameAndNamespace;
|
||||||
import org.springframework.http.codec.xml.jaxb.XmlType;
|
import org.springframework.http.codec.xml.jaxb.XmlType;
|
||||||
import org.springframework.http.codec.xml.jaxb.XmlTypeWithName;
|
import org.springframework.http.codec.xml.jaxb.XmlTypeWithName;
|
||||||
import org.springframework.http.codec.xml.jaxb.XmlTypeWithNameAndNamespace;
|
import org.springframework.http.codec.xml.jaxb.XmlTypeWithNameAndNamespace;
|
||||||
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.testfixture.codec.AbstractEncoderTests;
|
import org.springframework.core.testfixture.codec.AbstractEncoderTests;
|
||||||
import org.springframework.core.testfixture.xml.XmlContent;
|
import org.springframework.core.testfixture.xml.XmlContent;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.Pojo;
|
import org.springframework.web.testfixture.xml.Pojo;
|
||||||
|
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
|
@ -31,8 +31,8 @@ import org.springframework.core.io.Resource;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.server.ServletServerHttpRequest;
|
import org.springframework.http.server.ServletServerHttpRequest;
|
||||||
import org.springframework.http.server.ServletServerHttpResponse;
|
import org.springframework.http.server.ServletServerHttpResponse;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||||
|
|
|
@ -28,8 +28,8 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,9 @@ import org.springframework.core.io.buffer.DataBufferFactory;
|
||||||
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ import org.junit.jupiter.api.Test;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||||
|
|
|
@ -27,8 +27,9 @@ import org.springframework.http.HttpCookie;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseCookie;
|
import org.springframework.http.ResponseCookie;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,9 @@ import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,10 @@ import reactor.core.publisher.Mono;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.client.ClientHttpResponse;
|
import org.springframework.http.client.ClientHttpResponse;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.web.client.ResponseErrorHandler;
|
import org.springframework.web.client.ResponseErrorHandler;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import reactor.core.publisher.Flux;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.core.io.buffer.NettyDataBufferFactory;
|
import org.springframework.core.io.buffer.NettyDataBufferFactory;
|
||||||
import org.springframework.core.testfixture.io.buffer.LeakAwareDataBufferFactory;
|
import org.springframework.core.testfixture.io.buffer.LeakAwareDataBufferFactory;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -32,13 +32,14 @@ import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.codec.multipart.FilePart;
|
import org.springframework.http.codec.multipart.FilePart;
|
||||||
import org.springframework.http.codec.multipart.FormFieldPart;
|
import org.springframework.http.codec.multipart.FormFieldPart;
|
||||||
import org.springframework.http.codec.multipart.Part;
|
import org.springframework.http.codec.multipart.Part;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
import org.springframework.web.server.WebHandler;
|
import org.springframework.web.server.WebHandler;
|
||||||
import org.springframework.web.server.adapter.HttpWebHandlerAdapter;
|
import org.springframework.web.server.adapter.HttpWebHandlerAdapter;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,9 @@ import org.springframework.core.io.buffer.DataBufferFactory;
|
||||||
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,9 @@ import reactor.core.publisher.Mono;
|
||||||
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.http.ResponseEntity;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,11 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.mock.web.test.DelegatingServletInputStream;
|
|
||||||
import org.springframework.mock.web.test.MockAsyncContext;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.testfixture.servlet.DelegatingServletInputStream;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockAsyncContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||||
|
|
|
@ -33,9 +33,9 @@ import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.http.server.reactive.bootstrap.ReactorHttpsServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.ReactorHttpsServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,9 @@ import reactor.core.publisher.Mono;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,11 @@ import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.RequestEntity;
|
import org.springframework.http.RequestEntity;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.ZeroCopyHttpOutputMessage;
|
import org.springframework.http.ZeroCopyHttpOutputMessage;
|
||||||
import org.springframework.http.server.reactive.bootstrap.HttpServer;
|
|
||||||
import org.springframework.http.server.reactive.bootstrap.ReactorHttpServer;
|
|
||||||
import org.springframework.http.server.reactive.bootstrap.UndertowHttpServer;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.ReactorHttpServer;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.bootstrap.UndertowHttpServer;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||||
|
@ -38,7 +39,9 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||||
/**
|
/**
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
*/
|
*/
|
||||||
public class ZeroCopyIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
class ZeroCopyIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
||||||
|
|
||||||
|
private static final Resource springLogoResource = new ClassPathResource("/org/springframework/web/spring.png");
|
||||||
|
|
||||||
private final ZeroCopyHandler handler = new ZeroCopyHandler();
|
private final ZeroCopyHandler handler = new ZeroCopyHandler();
|
||||||
|
|
||||||
|
@ -50,9 +53,9 @@ public class ZeroCopyIntegrationTests extends AbstractHttpHandlerIntegrationTest
|
||||||
|
|
||||||
|
|
||||||
@ParameterizedHttpServerTest
|
@ParameterizedHttpServerTest
|
||||||
public void zeroCopy(HttpServer httpServer) throws Exception {
|
void zeroCopy(HttpServer httpServer) throws Exception {
|
||||||
assumeTrue(httpServer instanceof ReactorHttpServer || httpServer instanceof UndertowHttpServer,
|
assumeTrue(httpServer instanceof ReactorHttpServer || httpServer instanceof UndertowHttpServer,
|
||||||
"Zero-copy only does not support servlet");
|
"Zero-copy does not support Servlet");
|
||||||
|
|
||||||
startServer(httpServer);
|
startServer(httpServer);
|
||||||
|
|
||||||
|
@ -60,11 +63,9 @@ public class ZeroCopyIntegrationTests extends AbstractHttpHandlerIntegrationTest
|
||||||
RequestEntity<?> request = RequestEntity.get(url).build();
|
RequestEntity<?> request = RequestEntity.get(url).build();
|
||||||
ResponseEntity<byte[]> response = new RestTemplate().exchange(request, byte[].class);
|
ResponseEntity<byte[]> response = new RestTemplate().exchange(request, byte[].class);
|
||||||
|
|
||||||
Resource logo = new ClassPathResource("spring.png", ZeroCopyIntegrationTests.class);
|
|
||||||
|
|
||||||
assertThat(response.hasBody()).isTrue();
|
assertThat(response.hasBody()).isTrue();
|
||||||
assertThat(response.getHeaders().getContentLength()).isEqualTo(logo.contentLength());
|
assertThat(response.getHeaders().getContentLength()).isEqualTo(springLogoResource.contentLength());
|
||||||
assertThat(response.getBody().length).isEqualTo(logo.contentLength());
|
assertThat(response.getBody().length).isEqualTo(springLogoResource.contentLength());
|
||||||
assertThat(response.getHeaders().getContentType()).isEqualTo(MediaType.IMAGE_PNG);
|
assertThat(response.getHeaders().getContentType()).isEqualTo(MediaType.IMAGE_PNG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,8 +76,7 @@ public class ZeroCopyIntegrationTests extends AbstractHttpHandlerIntegrationTest
|
||||||
public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response) {
|
public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response) {
|
||||||
try {
|
try {
|
||||||
ZeroCopyHttpOutputMessage zeroCopyResponse = (ZeroCopyHttpOutputMessage) response;
|
ZeroCopyHttpOutputMessage zeroCopyResponse = (ZeroCopyHttpOutputMessage) response;
|
||||||
Resource logo = new ClassPathResource("spring.png", ZeroCopyIntegrationTests.class);
|
File logoFile = springLogoResource.getFile();
|
||||||
File logoFile = logo.getFile();
|
|
||||||
zeroCopyResponse.getHeaders().setContentType(MediaType.IMAGE_PNG);
|
zeroCopyResponse.getHeaders().setContentType(MediaType.IMAGE_PNG);
|
||||||
zeroCopyResponse.getHeaders().setContentLength(logoFile.length());
|
zeroCopyResponse.getHeaders().setContentLength(logoFile.length());
|
||||||
return zeroCopyResponse.writeWith(logoFile, 0, logoFile.length());
|
return zeroCopyResponse.writeWith(logoFile, 0, logoFile.length());
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
/**
|
|
||||||
* This package contains temporary interfaces and classes for running embedded servers.
|
|
||||||
* They are expected to be replaced by an upcoming Spring Boot support.
|
|
||||||
*/
|
|
||||||
package org.springframework.http.server.reactive.bootstrap;
|
|
|
@ -39,13 +39,13 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.remoting.RemoteAccessException;
|
import org.springframework.remoting.RemoteAccessException;
|
||||||
import org.springframework.remoting.support.DefaultRemoteInvocationExecutor;
|
import org.springframework.remoting.support.DefaultRemoteInvocationExecutor;
|
||||||
import org.springframework.remoting.support.RemoteInvocation;
|
import org.springframework.remoting.support.RemoteInvocation;
|
||||||
import org.springframework.remoting.support.RemoteInvocationFactory;
|
import org.springframework.remoting.support.RemoteInvocationFactory;
|
||||||
import org.springframework.remoting.support.RemoteInvocationResult;
|
import org.springframework.remoting.support.RemoteInvocationResult;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -26,12 +26,12 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.HttpMediaTypeNotAcceptableException;
|
import org.springframework.web.HttpMediaTypeNotAcceptableException;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -21,10 +21,10 @@ import java.util.List;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.web.HttpMediaTypeNotAcceptableException;
|
import org.springframework.web.HttpMediaTypeNotAcceptableException;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -24,10 +24,10 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.web.HttpMediaTypeNotAcceptableException;
|
import org.springframework.web.HttpMediaTypeNotAcceptableException;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.springframework.beans.PropertyValue;
|
||||||
import org.springframework.beans.PropertyValues;
|
import org.springframework.beans.PropertyValues;
|
||||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ package org.springframework.web.bind;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.testfixture.EnabledForTestGroups;
|
import org.springframework.core.testfixture.EnabledForTestGroups;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.util.StopWatch;
|
import org.springframework.util.StopWatch;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -34,12 +34,12 @@ import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.codec.FormHttpMessageWriter;
|
import org.springframework.http.codec.FormHttpMessageWriter;
|
||||||
import org.springframework.http.codec.multipart.FilePart;
|
import org.springframework.http.codec.multipart.FilePart;
|
||||||
import org.springframework.http.codec.multipart.MultipartHttpMessageWriter;
|
import org.springframework.http.codec.multipart.MultipartHttpMessageWriter;
|
||||||
import org.springframework.mock.http.client.reactive.test.MockClientHttpRequest;
|
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.web.test.server.MockServerWebExchange;
|
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
|
import org.springframework.web.testfixture.http.client.reactive.MockClientHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.server.MockServerWebExchange;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.core.ResolvableType.forClass;
|
import static org.springframework.core.ResolvableType.forClass;
|
||||||
|
@ -198,7 +198,7 @@ public class WebExchangeDataBinderTests {
|
||||||
data.add("someArray", "456");
|
data.add("someArray", "456");
|
||||||
data.add("part", new ClassPathResource("org/springframework/http/codec/multipart/foo.txt"));
|
data.add("part", new ClassPathResource("org/springframework/http/codec/multipart/foo.txt"));
|
||||||
data.add("somePartList", new ClassPathResource("org/springframework/http/codec/multipart/foo.txt"));
|
data.add("somePartList", new ClassPathResource("org/springframework/http/codec/multipart/foo.txt"));
|
||||||
data.add("somePartList", new ClassPathResource("org/springframework/http/server/reactive/spring.png"));
|
data.add("somePartList", new ClassPathResource("/org/springframework/web/spring.png"));
|
||||||
binder.bind(exchangeMultipart(data)).block(Duration.ofMillis(5000));
|
binder.bind(exchangeMultipart(data)).block(Duration.ofMillis(5000));
|
||||||
|
|
||||||
assertThat(bean.getName()).isEqualTo("bar");
|
assertThat(bean.getName()).isEqualTo("bar");
|
||||||
|
|
|
@ -29,12 +29,12 @@ import org.springframework.beans.PropertyValue;
|
||||||
import org.springframework.beans.PropertyValues;
|
import org.springframework.beans.PropertyValues;
|
||||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockMultipartFile;
|
|
||||||
import org.springframework.mock.web.test.MockMultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.bind.ServletRequestParameterPropertyValues;
|
import org.springframework.web.bind.ServletRequestParameterPropertyValues;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.multipart.support.StringMultipartFileEditor;
|
import org.springframework.web.multipart.support.StringMultipartFileEditor;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockMultipartFile;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockMultipartHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,9 @@ import javax.servlet.ServletException;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.BeanCreationException;
|
import org.springframework.beans.factory.BeanCreationException;
|
||||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -21,8 +21,8 @@ import javax.servlet.ServletRequestEvent;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.task.MockRunnable;
|
import org.springframework.core.task.MockRunnable;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.springframework.beans.testfixture.beans.DerivedTestBean;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.context.expression.StandardBeanExpressionResolver;
|
import org.springframework.context.expression.StandardBeanExpressionResolver;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.springframework.beans.testfixture.beans.ITestBean;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.beans.testfixture.beans.factory.DummyFactory;
|
import org.springframework.beans.testfixture.beans.factory.DummyFactory;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpSession;
|
import org.springframework.web.testfixture.servlet.MockHttpSession;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||||
|
|
|
@ -26,8 +26,8 @@ import java.util.Date;
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.ValueSource;
|
import org.junit.jupiter.params.provider.ValueSource;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME;
|
import static java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
|
@ -29,9 +29,9 @@ import javax.servlet.http.HttpServletResponseWrapper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.web.multipart.MultipartRequest;
|
import org.springframework.web.multipart.MultipartRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@ import org.springframework.beans.testfixture.beans.DerivedTestBean;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpSession;
|
import org.springframework.web.testfixture.servlet.MockHttpSession;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,11 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.support.GenericBeanDefinition;
|
import org.springframework.beans.factory.support.GenericBeanDefinition;
|
||||||
import org.springframework.beans.testfixture.beans.DerivedTestBean;
|
import org.springframework.beans.testfixture.beans.DerivedTestBean;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.web.context.ContextCleanupListener;
|
import org.springframework.web.context.ContextCleanupListener;
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ import javax.servlet.AsyncEvent;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockAsyncContext;
|
import org.springframework.web.testfixture.servlet.MockAsyncContext;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||||
|
|
|
@ -25,10 +25,10 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.task.AsyncTaskExecutor;
|
import org.springframework.core.task.AsyncTaskExecutor;
|
||||||
import org.springframework.mock.web.test.MockAsyncContext;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockAsyncContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.task.AsyncTaskExecutor;
|
import org.springframework.core.task.AsyncTaskExecutor;
|
||||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -25,10 +25,10 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.task.AsyncTaskExecutor;
|
import org.springframework.core.task.AsyncTaskExecutor;
|
||||||
import org.springframework.mock.web.test.MockAsyncContext;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockAsyncContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.io.IOException;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,9 @@ import javax.servlet.ServletContextEvent;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
|
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.web.context.ContextLoader;
|
import org.springframework.web.context.ContextLoader;
|
||||||
import org.springframework.web.context.ContextLoaderListener;
|
import org.springframework.web.context.ContextLoaderListener;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.context.annotation.AnnotationConfigUtils;
|
import org.springframework.context.annotation.AnnotationConfigUtils;
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ package org.springframework.web.cors;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -23,12 +23,12 @@ import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
import org.springframework.mock.web.test.server.MockServerWebExchange;
|
import org.springframework.web.testfixture.server.MockServerWebExchange;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.mock.http.server.reactive.test.MockServerHttpRequest.get;
|
import static org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest.get;
|
||||||
import static org.springframework.mock.http.server.reactive.test.MockServerHttpRequest.options;
|
import static org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest.options;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case for reactive {@link CorsUtils}.
|
* Test case for reactive {@link CorsUtils}.
|
||||||
|
|
|
@ -27,10 +27,10 @@ import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.web.test.server.MockServerWebExchange;
|
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
import org.springframework.web.server.WebFilterChain;
|
import org.springframework.web.server.WebFilterChain;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.server.MockServerWebExchange;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.http.HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS;
|
import static org.springframework.http.HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS;
|
||||||
|
|
|
@ -23,10 +23,10 @@ import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.web.test.server.MockServerWebExchange;
|
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.server.MockServerWebExchange;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.http.HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS;
|
import static org.springframework.http.HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS;
|
||||||
|
|
|
@ -18,9 +18,9 @@ package org.springframework.web.cors.reactive;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.web.test.server.MockServerWebExchange;
|
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.server.MockServerWebExchange;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockFilterConfig;
|
import org.springframework.web.testfixture.servlet.MockFilterConfig;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
import org.springframework.web.util.WebUtils;
|
import org.springframework.web.util.WebUtils;
|
||||||
|
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
|
|
|
@ -29,10 +29,10 @@ import javax.servlet.ServletResponse;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockFilterConfig;
|
import org.springframework.web.testfixture.servlet.MockFilterConfig;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,9 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.fail;
|
import static org.assertj.core.api.Assertions.fail;
|
||||||
|
|
|
@ -28,12 +28,12 @@ import javax.servlet.ServletResponse;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockFilterConfig;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
import org.springframework.web.context.WebApplicationContext;
|
||||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockFilterConfig;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||||
|
|
|
@ -25,9 +25,9 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.mock.web.test.MockFilterChain;
|
import org.springframework.web.testfixture.servlet.MockFilterChain;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockFilterChain;
|
import org.springframework.web.testfixture.servlet.MockFilterChain;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
|
@ -26,8 +26,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockFilterChain;
|
import org.springframework.web.testfixture.servlet.MockFilterChain;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
import org.springframework.web.util.WebUtils;
|
import org.springframework.web.util.WebUtils;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
|
@ -25,9 +25,9 @@ import org.mockito.Mockito;
|
||||||
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.mock.web.test.MockFilterChain;
|
import org.springframework.web.testfixture.servlet.MockFilterChain;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||||
|
|
|
@ -25,12 +25,12 @@ import javax.servlet.ServletResponse;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockFilterConfig;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.mock.web.test.MockServletContext;
|
|
||||||
import org.springframework.web.context.request.RequestAttributes;
|
import org.springframework.web.context.request.RequestAttributes;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockFilterConfig;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockServletContext;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||||
|
|
|
@ -24,10 +24,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.mock.web.test.MockHttpSession;
|
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpSession;
|
||||||
import org.springframework.web.util.ContentCachingRequestWrapper;
|
import org.springframework.web.util.ContentCachingRequestWrapper;
|
||||||
import org.springframework.web.util.WebUtils;
|
import org.springframework.web.util.WebUtils;
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
import org.springframework.util.StreamUtils;
|
import org.springframework.util.StreamUtils;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,10 @@ import reactor.test.StepVerifier;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.web.test.server.MockServerWebExchange;
|
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
import org.springframework.web.server.WebFilterChain;
|
import org.springframework.web.server.WebFilterChain;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.server.MockServerWebExchange;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import org.springframework.http.server.reactive.HttpHandler;
|
import org.springframework.http.server.reactive.HttpHandler;
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
|
||||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
|
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||||
|
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,12 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.web.bind.ServletRequestBindingException;
|
import org.springframework.web.bind.ServletRequestBindingException;
|
||||||
import org.springframework.web.bind.annotation.CookieValue;
|
import org.springframework.web.bind.annotation.CookieValue;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -20,13 +20,13 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.validation.Errors;
|
import org.springframework.validation.Errors;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||||
|
|
|
@ -24,12 +24,12 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||||
import org.springframework.core.convert.ConversionService;
|
import org.springframework.core.convert.ConversionService;
|
||||||
import org.springframework.format.support.DefaultFormattingConversionService;
|
import org.springframework.format.support.DefaultFormattingConversionService;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -35,6 +34,7 @@ import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
|
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
|
||||||
import org.springframework.web.method.support.InvocableHandlerMethod;
|
import org.springframework.web.method.support.InvocableHandlerMethod;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||||
|
|
|
@ -22,14 +22,14 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.method.ResolvableMethod;
|
|
||||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
import org.springframework.web.testfixture.method.ResolvableMethod;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.testfixture.beans.TestBean;
|
import org.springframework.beans.testfixture.beans.TestBean;
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.validation.BindException;
|
import org.springframework.validation.BindException;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.validation.Errors;
|
import org.springframework.validation.Errors;
|
||||||
|
@ -39,6 +38,7 @@ import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.context.request.WebRequest;
|
import org.springframework.web.context.request.WebRequest;
|
||||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static java.lang.annotation.ElementType.CONSTRUCTOR;
|
import static java.lang.annotation.ElementType.CONSTRUCTOR;
|
||||||
import static java.lang.annotation.ElementType.FIELD;
|
import static java.lang.annotation.ElementType.FIELD;
|
||||||
|
|
|
@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.MethodIntrospector;
|
import org.springframework.core.MethodIntrospector;
|
||||||
import org.springframework.core.annotation.AnnotationUtils;
|
import org.springframework.core.annotation.AnnotationUtils;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
@ -46,6 +44,8 @@ import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
|
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
|
||||||
import org.springframework.web.method.support.InvocableHandlerMethod;
|
import org.springframework.web.method.support.InvocableHandlerMethod;
|
||||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
|
@ -40,6 +39,7 @@ import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
|
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
|
||||||
import org.springframework.web.method.support.InvocableHandlerMethod;
|
import org.springframework.web.method.support.InvocableHandlerMethod;
|
||||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -22,12 +22,12 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.ui.ExtendedModelMap;
|
import org.springframework.ui.ExtendedModelMap;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,13 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
||||||
import org.springframework.format.support.DefaultFormattingConversionService;
|
import org.springframework.format.support.DefaultFormattingConversionService;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
import org.springframework.web.bind.ServletRequestBindingException;
|
import org.springframework.web.bind.ServletRequestBindingException;
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
@ -41,6 +39,8 @@ import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
|
@ -24,21 +24,21 @@ import javax.servlet.http.Part;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.mock.web.test.MockMultipartFile;
|
|
||||||
import org.springframework.mock.web.test.MockMultipartHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockPart;
|
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.method.ResolvableMethod;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.testfixture.method.ResolvableMethod;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockMultipartFile;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockMultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockPart;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.web.method.MvcAnnotationPredicates.requestParam;
|
import static org.springframework.web.testfixture.method.MvcAnnotationPredicates.requestParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test fixture with {@link RequestParamMapMethodArgumentResolver}.
|
* Test fixture with {@link RequestParamMapMethodArgumentResolver}.
|
||||||
|
|
|
@ -28,11 +28,6 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
|
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.core.convert.support.DefaultConversionService;
|
import org.springframework.core.convert.support.DefaultConversionService;
|
||||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockHttpServletResponse;
|
|
||||||
import org.springframework.mock.web.test.MockMultipartFile;
|
|
||||||
import org.springframework.mock.web.test.MockMultipartHttpServletRequest;
|
|
||||||
import org.springframework.mock.web.test.MockPart;
|
|
||||||
import org.springframework.web.bind.MissingServletRequestParameterException;
|
import org.springframework.web.bind.MissingServletRequestParameterException;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
@ -43,17 +38,22 @@ import org.springframework.web.bind.support.WebDataBinderFactory;
|
||||||
import org.springframework.web.bind.support.WebRequestDataBinder;
|
import org.springframework.web.bind.support.WebRequestDataBinder;
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.context.request.ServletWebRequest;
|
import org.springframework.web.context.request.ServletWebRequest;
|
||||||
import org.springframework.web.method.ResolvableMethod;
|
|
||||||
import org.springframework.web.multipart.MultipartException;
|
import org.springframework.web.multipart.MultipartException;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.multipart.support.MissingServletRequestPartException;
|
import org.springframework.web.multipart.support.MissingServletRequestPartException;
|
||||||
|
import org.springframework.web.testfixture.method.ResolvableMethod;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockHttpServletResponse;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockMultipartFile;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockMultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.testfixture.servlet.MockPart;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.springframework.web.method.MvcAnnotationPredicates.requestParam;
|
import static org.springframework.web.testfixture.method.MvcAnnotationPredicates.requestParam;
|
||||||
import static org.springframework.web.method.MvcAnnotationPredicates.requestPart;
|
import static org.springframework.web.testfixture.method.MvcAnnotationPredicates.requestPart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test fixture with {@link RequestParamMethodArgumentResolver}.
|
* Test fixture with {@link RequestParamMethodArgumentResolver}.
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue