Skip to content

Commit b5ae3f8

Browse files
committed
[java] remove requiredCapabilities from metadata ignored list
1 parent b74d940 commit b5ae3f8

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

java/src/org/openqa/selenium/remote/NewSessionPayload.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ public Set<Dialect> getDownstreamDialects() {
251251
}
252252

253253
public Map<String, Object> getMetadata() {
254-
Set<String> ignoredMetadataKeys =
255-
Set.of("capabilities", "requiredCapabilities");
254+
Set<String> ignoredMetadataKeys = Set.of("capabilities");
256255

257256
try (Reader reader =
258257
new InputStreamReader(backingStore.asByteSource().openBufferedStream(), UTF_8);

java/test/org/openqa/selenium/remote/NewSessionPayloadTest.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import static org.assertj.core.api.Assertions.assertThat;
2828
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
2929
import static org.junit.jupiter.api.Assertions.assertEquals;
30-
import static org.junit.jupiter.api.Assertions.assertNull;
3130
import static org.openqa.selenium.json.Json.MAP_TYPE;
3231

3332
import com.google.common.collect.ImmutableMap;
@@ -196,23 +195,6 @@ void forwardsMetaDataAssociatedWithARequest() throws IOException {
196195
}
197196
}
198197

199-
@Test
200-
void doesNotForwardRequiredCapabilitiesAsTheseAreVeryLegacy() throws IOException {
201-
try (NewSessionPayload payload =
202-
NewSessionPayload.create(
203-
ImmutableMap.of(
204-
"capabilities",
205-
EMPTY_MAP,
206-
"requiredCapabilities",
207-
singletonMap("key", "so it's not empty")))) {
208-
StringBuilder toParse = new StringBuilder();
209-
payload.writeTo(toParse);
210-
Map<String, Object> seen = new Json().toType(toParse.toString(), MAP_TYPE);
211-
212-
assertNull(seen.get("requiredCapabilities"));
213-
}
214-
}
215-
216198
@Test
217199
void shouldPreserveMetadata() throws IOException {
218200
Map<String, Object> raw =
@@ -263,8 +245,7 @@ void nullValuesInMetaDataAreIgnored() {
263245
void keysUsedForStoringCapabilitiesAreIgnoredFromMetadata() {
264246
Map<String, Object> raw =
265247
ImmutableMap.of(
266-
"capabilities", singletonMap("alwaysMatch", singletonMap("browserName", "cheese")),
267-
"desiredCapabilities", emptyMap());
248+
"capabilities", singletonMap("alwaysMatch", singletonMap("browserName", "cheese")));
268249

269250
try (NewSessionPayload payload = NewSessionPayload.create(raw)) {
270251
Map<String, Object> seen = payload.getMetadata();

0 commit comments

Comments
 (0)