Skip to content

Commit fd7a4b6

Browse files
committed
[java] Changing a test for RemoteWebDriverBuilder to analyze requests in time, later the streams can be closed
1 parent e874b53 commit fd7a4b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/client/test/org/openqa/selenium/remote/RemoteWebDriverBuilderTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ public void justCallingBuildWithoutSettingAnyOptionsIsAnError() {
7676

7777
@Test
7878
public void mustSpecifyAtLeastOneSetOfOptions() {
79-
List<HttpRequest> requests = new ArrayList<>();
79+
List<List<Capabilities>> caps = new ArrayList<>();
8080

8181
RemoteWebDriver.builder().oneOf(new FirefoxOptions())
8282
.address("http://localhost:34576")
8383
.connectingWith(config -> req -> {
84-
requests.add(req);
84+
caps.add(listCapabilities(req));
8585
return CANNED_SESSION_RESPONSE;
8686
})
8787
.build();
8888

89-
assertThat(requests).isNotEmpty();
90-
List<Capabilities> caps = listCapabilities(requests.get(0));
91-
assertThat(caps.get(0).getBrowserName()).isEqualTo(FIREFOX);
89+
assertThat(caps).hasSize(1);
90+
List<Capabilities> caps0 = caps.get(0);
91+
assertThat(caps0.get(0).getBrowserName()).isEqualTo(FIREFOX);
9292
}
9393

9494
@Test

0 commit comments

Comments
 (0)