Name the unused Mockito answer parameter for Java 21 compatibility ReplicationQueueTest used an unnamed variable (`_`) as the thenAnswer lambda parameter. Unnamed variables are a standard feature only in Java 22+; under a Java 21 language level they are a disabled preview feature and fail to compile. Give the parameter a name so the test builds on both Java 21 and Java 25. Change-Id: Ib121547711a022a1ec1304289b905cb6c5f54428
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationQueueTest.java b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationQueueTest.java index adb16c9..3a10570 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationQueueTest.java +++ b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationQueueTest.java
@@ -76,7 +76,7 @@ when(destinations.getDestinations(any(), any(), any())).thenReturn(List.of(destination)); ReplicationTasksStorage tasksStorage = mock(ReplicationTasksStorage.class); - when(tasksStorage.streamWaiting()).thenAnswer(_ -> List.copyOf(waitingTasks).stream()); + when(tasksStorage.streamWaiting()).thenAnswer(invocation -> List.copyOf(waitingTasks).stream()); defaultQueue = new ScheduledThreadPoolExecutor(1); workQueue = mock(WorkQueue.class);