Skip to content

Commit 1181d73

Browse files
committed
replaced list creations with List.of()
there is no need to creat mutable lists in tests to only get elements
1 parent 674e764 commit 1181d73

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

java/test/org/openqa/selenium/ExecutingAsyncJavascriptTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void shouldCatchErrorsWithMessageAndStacktraceWhenExecutingInitialScript(
244244
t -> {
245245
Throwable rootCause = getRootCause(t);
246246
assertThat(rootCause).hasMessageContaining("errormessage");
247-
assertThat(Arrays.asList(rootCause.getStackTrace()))
247+
assertThat(List.of(rootCause.getStackTrace()))
248248
.extracting(StackTraceElement::getMethodName)
249249
.contains("functionB");
250250
});

java/test/org/openqa/selenium/ExecutingJavascriptTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public void testShouldThrowAnExceptionWithMessageAndStacktraceWhenTheJavascriptI
264264
t -> {
265265
Throwable rootCause = getRootCause(t);
266266
assertThat(rootCause).hasMessageContaining("errormessage");
267-
assertThat(Arrays.asList(rootCause.getStackTrace()))
267+
assertThat(List.of(rootCause.getStackTrace()))
268268
.extracting(StackTraceElement::getMethodName)
269269
.contains("functionB");
270270
});

java/test/org/openqa/selenium/grid/router/SessionQueueGridWithTimeoutTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void shouldBeAbleToDeleteTimedoutSessions() {
163163
try {
164164
Callable<HttpResponse> sessionCreationTask = () -> createSession(caps);
165165
List<Future<HttpResponse>> futureList =
166-
fixedThreadPoolService.invokeAll(Arrays.asList(sessionCreationTask));
166+
fixedThreadPoolService.invokeAll(List.of(sessionCreationTask));
167167

168168
for (Future<HttpResponse> future : futureList) {
169169
HttpResponse httpResponse = future.get(10, SECONDS);

0 commit comments

Comments
 (0)