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

This commit is contained in:
Sam Brannen
2022-12-09 12:25:47 -05:00
parent 4caf3c8ce0
commit a1a140f7d5
12 changed files with 78 additions and 115 deletions

View File

@@ -18,7 +18,6 @@ package org.springframework.mock.http.client;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequest;
@@ -51,12 +50,7 @@ public class MockClientHttpRequest extends MockHttpOutputMessage implements Clie
*/
public MockClientHttpRequest() {
this.httpMethod = HttpMethod.GET;
try {
this.uri = new URI("/");
}
catch (URISyntaxException ex) {
throw new IllegalStateException(ex);
}
this.uri = URI.create("/");
}
/**