[java] add deprecation notices to Grid logs and Java stdout
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
+import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.logging.Logger;
+import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.google.common.net.HttpHeaders.CONTENT_LENGTH;
@@ -63,7 +65,19 @@ public Result createSession(HttpHandler client, Command command) throws IOExcept
if (result.isRight()) {
Result toReturn = result.right();
- LOG.info(String.format("Detected dialect: %s", toReturn.dialect));
+ LOG.info(String.format("Detected upstream dialect: %s", toReturn.dialect));
+
+ List<String> invalid = desired.asMap().keySet()
+ .stream()
+ .filter(key -> !(new AcceptedW3CCapabilityKeys().test(key)))
+ .collect(Collectors.toList());
+
+ if (!invalid.isEmpty()) {
+ LOG.warning(String.format("Support for Legacy Capabilities is deprecated; " +
+ "You are sending the following invalid capabilities: %s; " +
+ "Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/",
+ invalid));
+ }
return toReturn;
} else {
throw result.left();
