|
|
|
|
@ -14,7 +14,7 @@
@@ -14,7 +14,7 @@
|
|
|
|
|
* limitations under the License. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
package org.springframework.test.web.servlet.client.samples; |
|
|
|
|
package org.springframework.test.web.servlet.client; |
|
|
|
|
|
|
|
|
|
import java.net.URI; |
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
@ -36,7 +36,6 @@ import org.springframework.core.ParameterizedTypeReference;
@@ -36,7 +36,6 @@ import org.springframework.core.ParameterizedTypeReference;
|
|
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
|
import org.springframework.http.HttpMethod; |
|
|
|
|
import org.springframework.http.MediaType; |
|
|
|
|
import org.springframework.test.web.servlet.client.RestTestClient; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestHeader; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
@ -51,11 +50,13 @@ class RestTestClientTests {
@@ -51,11 +50,13 @@ class RestTestClientTests {
|
|
|
|
|
|
|
|
|
|
private RestTestClient client; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
|
void setUp() { |
|
|
|
|
this.client = RestTestClient.bindToController(new TestController()).build(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nested |
|
|
|
|
class HttpMethods { |
|
|
|
|
|
|
|
|
|
@ -127,6 +128,7 @@ class RestTestClientTests {
@@ -127,6 +128,7 @@ class RestTestClientTests {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nested |
|
|
|
|
class Mutation { |
|
|
|
|
|
|
|
|
|
@ -149,6 +151,7 @@ class RestTestClientTests {
@@ -149,6 +151,7 @@ class RestTestClientTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nested |
|
|
|
|
class Uris { |
|
|
|
|
|
|
|
|
|
@ -193,6 +196,7 @@ class RestTestClientTests {
@@ -193,6 +196,7 @@ class RestTestClientTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nested |
|
|
|
|
class Cookies { |
|
|
|
|
@Test |
|
|
|
|
@ -214,6 +218,7 @@ class RestTestClientTests {
@@ -214,6 +218,7 @@ class RestTestClientTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nested |
|
|
|
|
class Headers { |
|
|
|
|
@Test |
|
|
|
|
@ -271,6 +276,7 @@ class RestTestClientTests {
@@ -271,6 +276,7 @@ class RestTestClientTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nested |
|
|
|
|
class Expectations { |
|
|
|
|
@Test |
|
|
|
|
@ -281,6 +287,7 @@ class RestTestClientTests {
@@ -281,6 +287,7 @@ class RestTestClientTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nested |
|
|
|
|
class ReturnResults { |
|
|
|
|
@Test |
|
|
|
|
@ -312,6 +319,7 @@ class RestTestClientTests {
@@ -312,6 +319,7 @@ class RestTestClientTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RestController |
|
|
|
|
static class TestController { |
|
|
|
|
|