58
58
import java .io .UncheckedIOException ;
59
59
import java .lang .reflect .Array ;
60
60
import java .net .URL ;
61
+ import java .time .Duration ;
61
62
import java .util .Arrays ;
62
63
import java .util .Collections ;
63
64
import java .util .List ;
64
65
import java .util .Map ;
65
66
import java .util .Optional ;
66
67
import java .util .Set ;
67
68
import java .util .UUID ;
68
- import java .util .concurrent .TimeUnit ;
69
69
import java .util .function .Function ;
70
70
import java .util .logging .Level ;
71
71
import java .util .stream .Collectors ;
@@ -858,7 +858,7 @@ public void canHandleSetImplicitWaitCommand() throws IOException {
858
858
CommandExecutor executor = prepareExecutorMock (echoCapabilities , nullValueResponder );
859
859
860
860
RemoteWebDriver driver = new RemoteWebDriver (executor , new ImmutableCapabilities ());
861
- driver .manage ().timeouts ().implicitlyWait (10 , TimeUnit . SECONDS );
861
+ driver .manage ().timeouts ().implicitlyWait (Duration . ofSeconds ( 10 ) );
862
862
863
863
verifyCommands (
864
864
executor , driver .getSessionId (),
@@ -870,7 +870,7 @@ public void canHandleSetScriptTimeoutCommand() throws IOException {
870
870
CommandExecutor executor = prepareExecutorMock (echoCapabilities , nullValueResponder );
871
871
872
872
RemoteWebDriver driver = new RemoteWebDriver (executor , new ImmutableCapabilities ());
873
- driver .manage ().timeouts ().setScriptTimeout (10 , TimeUnit . SECONDS );
873
+ driver .manage ().timeouts ().setScriptTimeout (Duration . ofSeconds ( 10 ) );
874
874
875
875
verifyCommands (
876
876
executor , driver .getSessionId (),
@@ -882,7 +882,7 @@ public void canHandleSetPageLoadTimeoutCommand() throws IOException {
882
882
CommandExecutor executor = prepareExecutorMock (echoCapabilities , nullValueResponder );
883
883
884
884
RemoteWebDriver driver = new RemoteWebDriver (executor , new ImmutableCapabilities ());
885
- driver .manage ().timeouts ().pageLoadTimeout (10 , TimeUnit . SECONDS );
885
+ driver .manage ().timeouts ().pageLoadTimeout (Duration . ofSeconds ( 10 ) );
886
886
887
887
verifyCommands (
888
888
executor , driver .getSessionId (),
@@ -1211,8 +1211,8 @@ public void canHandleElementCssPropertyCommand() throws IOException {
1211
1211
ImmutableMap .of ("id" , element .getId (), "propertyName" , "color" )));
1212
1212
}
1213
1213
1214
- private class MultiCommandPayload extends CommandPayload {
1215
- private int times ;
1214
+ private static class MultiCommandPayload extends CommandPayload {
1215
+ private final int times ;
1216
1216
1217
1217
MultiCommandPayload (int times , String name , Map <String , ?> parameters ) {
1218
1218
super (name , parameters );
@@ -1283,9 +1283,7 @@ private boolean isWebElement(Object value) {
1283
1283
.isPresent ();
1284
1284
}
1285
1285
1286
- private final Function <Command , Response > nullResponder = cmd -> {
1287
- return null ;
1288
- };
1286
+ private final Function <Command , Response > nullResponder = cmd -> null ;
1289
1287
1290
1288
private final Function <Command , Response > exceptionResponder = cmd -> {
1291
1289
throw new InternalError ("BOOM!!!" );
0 commit comments