Polishing

This commit is contained in:
Juergen Hoeller
2020-06-10 11:19:52 +02:00
parent 7f87eb56d9
commit a045574418
38 changed files with 284 additions and 268 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2020 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.
@@ -97,8 +97,8 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
return this.remoteAddress;
}
@Nullable
@Override
@Nullable
protected SslInfo initSslInfo() {
return this.sslInfo;
}
@@ -342,9 +342,9 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
* @see BodyBuilder#body(String)
*/
MockServerHttpRequest build();
}
/**
* A builder that adds a body to the request.
*/
@@ -383,7 +383,6 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
* @return the built request entity
*/
MockServerHttpRequest body(String body);
}
@@ -391,7 +390,6 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
private static final DataBufferFactory BUFFER_FACTORY = new DefaultDataBufferFactory();
private final HttpMethod method;
private final URI url;
@@ -411,7 +409,6 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
@Nullable
private SslInfo sslInfo;
public DefaultBodyBuilder(HttpMethod method, URI url) {
this.method = method;
this.url = url;
@@ -558,13 +555,11 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
private URI getUrlToUse() {
MultiValueMap<String, String> params =
this.queryParamsBuilder.buildAndExpand().encode().getQueryParams();
if (!params.isEmpty()) {
return UriComponentsBuilder.fromUri(this.url).queryParams(params).build(true).toUri();
}
return this.url;
}
}
}
}