Skip to content

Commit

Permalink
replaced list creations with List.of()
Browse files Browse the repository at this point in the history
there is no need to creat mutable lists in tests to only get elements
  • Loading branch information
iampopovich committed May 30, 2024
1 parent 674e764 commit 1181d73
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public void shouldCatchErrorsWithMessageAndStacktraceWhenExecutingInitialScript(
t -> {
Throwable rootCause = getRootCause(t);
assertThat(rootCause).hasMessageContaining("errormessage");
assertThat(Arrays.asList(rootCause.getStackTrace()))
assertThat(List.of(rootCause.getStackTrace()))
.extracting(StackTraceElement::getMethodName)
.contains("functionB");
});
Expand Down
2 changes: 1 addition & 1 deletion java/test/org/openqa/selenium/ExecutingJavascriptTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void testShouldThrowAnExceptionWithMessageAndStacktraceWhenTheJavascriptI
t -> {
Throwable rootCause = getRootCause(t);
assertThat(rootCause).hasMessageContaining("errormessage");
assertThat(Arrays.asList(rootCause.getStackTrace()))
assertThat(List.of(rootCause.getStackTrace()))
.extracting(StackTraceElement::getMethodName)
.contains("functionB");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void shouldBeAbleToDeleteTimedoutSessions() {
try {
Callable<HttpResponse> sessionCreationTask = () -> createSession(caps);
List<Future<HttpResponse>> futureList =
fixedThreadPoolService.invokeAll(Arrays.asList(sessionCreationTask));
fixedThreadPoolService.invokeAll(List.of(sessionCreationTask));

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

0 comments on commit 1181d73

Please sign in to comment.