[Grid] Getting scheme from configuration instead of using the class name.
private static final Logger LOG = Logger.getLogger(SessionMapOptions.class.getName());
private static final String DEFAULT_SESSION_MAP = "org.openqa.selenium.grid.sessionmap.remote.RemoteSessionMap";
+ private static final String DEFAULT_SESSION_MAP_SCHEME = "http";
private final Config config;
public SessionMapOptions(Config config) {
@@ -40,8 +41,7 @@ public SessionMapOptions(Config config) {
public URI getSessionMapUri() {
- String scheme = "http";
- Optional<String> implementation = config.get(SESSIONS_SECTION, "implementation");
+ String scheme = config.get(SESSIONS_SECTION, "scheme").orElse(DEFAULT_SESSION_MAP_SCHEME);
Optional<URI> host = config.get(SESSIONS_SECTION, "host").map(str -> {
try {
@@ -62,10 +62,6 @@ public URI getSessionMapUri() {
throw new ConfigException("Unable to determine host and port for the session map server");
}
- if (implementation.toString().contains("redis")) {
- scheme = "redis"; // RedisBackedSessionMap needs the scheme to be `redis://..`
- }
-
try {
return new URI(
scheme,
