Polishing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user