mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Polishing
This commit is contained in:
+1
-1
@@ -92,7 +92,7 @@ class CookieIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
||||
public void cookiesWithSameNameTest(HttpServer httpServer) throws Exception {
|
||||
startServer(httpServer);
|
||||
|
||||
ResponseEntity<Void> response = getRestClient().get()
|
||||
getRestClient().get()
|
||||
.header("Cookie", "SID=31d4d96e407aad42; lang=en-US; lang=zh-CN")
|
||||
.retrieve().toBodilessEntity();
|
||||
|
||||
|
||||
+6
-6
@@ -241,8 +241,8 @@ class RestTemplateIntegrationTests extends AbstractMockWebServerTests {
|
||||
setUpClient(clientHttpRequestFactory);
|
||||
|
||||
String url = baseUrl + "/status/notfound";
|
||||
assertThatExceptionOfType(HttpClientErrorException.class).isThrownBy(() ->
|
||||
template.execute(url, HttpMethod.GET, null, null))
|
||||
assertThatExceptionOfType(HttpClientErrorException.class)
|
||||
.isThrownBy(() -> template.execute(url, HttpMethod.GET, null, null))
|
||||
.satisfies(ex -> {
|
||||
assertThat(ex.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
|
||||
assertThat(ex.getStatusText()).isNotNull();
|
||||
@@ -260,8 +260,8 @@ class RestTemplateIntegrationTests extends AbstractMockWebServerTests {
|
||||
setUpClient(clientHttpRequestFactory);
|
||||
|
||||
String url = baseUrl + "/status/badrequest";
|
||||
assertThatExceptionOfType(HttpClientErrorException.class).isThrownBy(() ->
|
||||
template.execute(url, HttpMethod.GET, null, null))
|
||||
assertThatExceptionOfType(HttpClientErrorException.class)
|
||||
.isThrownBy(() -> template.execute(url, HttpMethod.GET, null, null))
|
||||
.satisfies(ex -> {
|
||||
assertThat(ex.getStatusCode()).isEqualTo(HttpStatus.BAD_REQUEST);
|
||||
assertThat(ex.getMessage()).containsSubsequence("400", "on GET request for \""+url+ "\": [no body]");
|
||||
@@ -276,8 +276,8 @@ class RestTemplateIntegrationTests extends AbstractMockWebServerTests {
|
||||
setUpClient(clientHttpRequestFactory);
|
||||
|
||||
String url = baseUrl + "/status/server";
|
||||
assertThatExceptionOfType(HttpServerErrorException.class).isThrownBy(() ->
|
||||
template.execute(url, HttpMethod.GET, null, null))
|
||||
assertThatExceptionOfType(HttpServerErrorException.class)
|
||||
.isThrownBy(() -> template.execute(url, HttpMethod.GET, null, null))
|
||||
.satisfies(ex -> {
|
||||
assertThat(ex.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
assertThat(ex.getStatusText()).isNotNull();
|
||||
|
||||
Reference in New Issue
Block a user