Use URI#create instead of URI constructor where feasible in spring-web

This commit is contained in:
Sam Brannen
2022-12-09 13:26:01 -05:00
parent a1a140f7d5
commit 1b57f2bda5
31 changed files with 163 additions and 178 deletions

View File

@@ -20,7 +20,6 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
@@ -59,12 +58,7 @@ public class MockClientHttpRequest implements ClientHttpRequest {
public MockClientHttpRequest() {
this.httpMethod = HttpMethod.GET;
try {
this.uri = new URI("/");
}
catch (URISyntaxException ex) {
throw new IllegalStateException(ex);
}
this.uri = URI.create("/");
}
public MockClientHttpRequest(HttpMethod httpMethod, String urlTemplate, Object... vars) {