Polish
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,6 +27,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.validation.Payload;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Null;
|
||||
import javax.validation.constraints.Size;
|
||||
@@ -35,7 +36,6 @@ import org.hamcrest.BaseMatcher;
|
||||
import org.hamcrest.Description;
|
||||
import org.hibernate.validator.constraints.CompositionType;
|
||||
import org.hibernate.validator.constraints.ConstraintComposition;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,7 +24,6 @@ import org.springframework.restdocs.operation.OperationResponse;
|
||||
import org.springframework.restdocs.operation.OperationResponseFactory;
|
||||
import org.springframework.restdocs.operation.ResponseConverter;
|
||||
import org.springframework.test.web.reactive.server.ExchangeResult;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -37,8 +36,6 @@ class WebTestClientResponseConverter implements ResponseConverter<ExchangeResult
|
||||
|
||||
@Override
|
||||
public OperationResponse convert(ExchangeResult result) {
|
||||
MultiValueMap<String, ResponseCookie> responseCookies = result
|
||||
.getResponseCookies();
|
||||
return new OperationResponseFactory().create(result.getStatus(),
|
||||
extractHeaders(result), result.getResponseBodyContent());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -52,7 +52,7 @@ public class WebTestClientRestDocumentationConfigurerTests {
|
||||
|
||||
@Test
|
||||
public void configurationCanBeRetrievedButOnlyOnce() {
|
||||
ClientRequest request = ClientRequest.method(HttpMethod.GET, URI.create("/test"))
|
||||
ClientRequest request = ClientRequest.create(HttpMethod.GET, URI.create("/test"))
|
||||
.header(WebTestClient.WEBTESTCLIENT_REQUEST_ID, "1").build();
|
||||
this.configurer.filter(request, mock(ExchangeFunction.class));
|
||||
Map<String, Object> configuration = WebTestClientRestDocumentationConfigurer
|
||||
@@ -65,7 +65,7 @@ public class WebTestClientRestDocumentationConfigurerTests {
|
||||
@Test
|
||||
public void requestUriHasDefaultsAppliedWhenItHasNoHost() {
|
||||
ClientRequest request = ClientRequest
|
||||
.method(HttpMethod.GET, URI.create("/test?foo=bar#baz"))
|
||||
.create(HttpMethod.GET, URI.create("/test?foo=bar#baz"))
|
||||
.header(WebTestClient.WEBTESTCLIENT_REQUEST_ID, "1").build();
|
||||
ExchangeFunction exchangeFunction = mock(ExchangeFunction.class);
|
||||
this.configurer.filter(request, exchangeFunction);
|
||||
@@ -79,7 +79,7 @@ public class WebTestClientRestDocumentationConfigurerTests {
|
||||
@Test
|
||||
public void requestUriIsNotChangedWhenItHasAHost() {
|
||||
ClientRequest request = ClientRequest
|
||||
.method(HttpMethod.GET,
|
||||
.create(HttpMethod.GET,
|
||||
URI.create("https://api.example.com:4567/test?foo=bar#baz"))
|
||||
.header(WebTestClient.WEBTESTCLIENT_REQUEST_ID, "1").build();
|
||||
ExchangeFunction exchangeFunction = mock(ExchangeFunction.class);
|
||||
|
||||
Reference in New Issue
Block a user