[java] Fixing use of a method introduced in Java 10
import org.openqa.selenium.remote.http.HttpHandler;
import org.openqa.selenium.remote.http.HttpResponse;
+import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Map;
import java.util.Set;
@@ -41,7 +42,8 @@ public void shouldReturnImageIfTagIsPresent() {
HttpHandler handler = req -> {
String filters = req.getQueryParameter("filters");
- String decoded = URLDecoder.decode(filters, UTF_8);
+ try {
+ String decoded = URLDecoder.decode(filters, "UTF-8");
Map<String, Object> raw = new Json().toType(decoded, MAP_TYPE);
System.out.println(decoded);
@@ -54,11 +56,15 @@ public void shouldReturnImageIfTagIsPresent() {
.addHeader("Content-Type", "application/json")
.setContent(Contents.utf8String(
"[{\"Containers\":-1,\"Created\":1581716253," +
- "\"Id\":\"sha256:bc24341497a00a3afbf04c518cb4bf98834d933ae331d1c5d3cd6f52c079049e\"," +
+ "\"Id\":\"sha256:bc24341497a00a3afbf04c518cb4bf98834d933ae331d1c5d3cd6f52c079049e\","
+ +
"\"Labels\":{\"authors\":\"SeleniumHQ\"},\"ParentId\":\"\"," +
"\"RepoDigests\":null," +
"\"RepoTags\":[\"selenium/standalone-firefox:latest\"]," +
"\"SharedSize\":-1,\"Size\":765131593,\"VirtualSize\":765131593}]"));
+ } catch (UnsupportedEncodingException ignore) {
+ return null;
+ }
};
Reference reference = Reference.parse(
