Skip to content

Commit 03d8053

Browse files
committed
[grid] Fixing mock in DriverServiceSessionFactoryTest
1 parent f950543 commit 03d8053

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎java/test/org/openqa/selenium/grid/node/config/DriverServiceSessionFactoryTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.openqa.selenium.grid.node.ActiveSession;
3030
import org.openqa.selenium.internal.Either;
3131
import org.openqa.selenium.remote.Dialect;
32+
import org.openqa.selenium.remote.http.ClientConfig;
3233
import org.openqa.selenium.remote.http.HttpClient;
3334
import org.openqa.selenium.remote.http.HttpRequest;
3435
import org.openqa.selenium.remote.http.HttpResponse;
@@ -147,9 +148,9 @@ public void shouldNotInstantiateSessionIfRemoteEndReturnsInvalidResponse() throw
147148
public void shouldInstantiateSessionIfEverythingIsOK() throws IOException {
148149
HttpClient httpClient = mock(HttpClient.class);
149150
when(httpClient.execute(any(HttpRequest.class))).thenReturn(
150-
new HttpResponse().setStatus(200).setContent(() -> new ByteArrayInputStream(
151-
"{ \"value\": { \"sessionId\": \"1\", \"capabilities\": {} } }".getBytes())));
152-
when(clientFactory.createClient(any(URL.class))).thenReturn(httpClient);
151+
new HttpResponse().setStatus(200).setContent(() -> new ByteArrayInputStream(
152+
"{ \"value\": { \"sessionId\": \"1\", \"capabilities\": {} } }".getBytes())));
153+
when(clientFactory.createClient(any(ClientConfig.class))).thenReturn(httpClient);
153154

154155
DriverServiceSessionFactory factory = factoryFor("chrome", builder);
155156

0 commit comments

Comments
 (0)