|
52 | 52 | import static org.hamcrest.Matchers.greaterThanOrEqualTo; |
53 | 53 | import static org.hamcrest.Matchers.not; |
54 | 54 | import static org.mockito.ArgumentMatchers.any; |
55 | | -import static org.mockito.ArgumentMatchers.argThat; |
56 | 55 | import static org.mockito.Mockito.mock; |
57 | 56 | import static org.mockito.Mockito.times; |
58 | 57 | import static org.mockito.Mockito.verify; |
@@ -133,7 +132,7 @@ public void testReturnsOnlyRequestedStats() throws Exception { |
133 | 132 | )) { |
134 | 133 | var request = new TransportGetAllocationStatsAction.Request(TimeValue.ONE_MINUTE, TaskId.EMPTY_TASK_ID, metrics); |
135 | 134 |
|
136 | | - when(allocationStatsService.stats(argThat(r -> true))).thenReturn( |
| 135 | + when(allocationStatsService.stats(any())).thenReturn( |
137 | 136 | Map.of(randomIdentifier(), NodeAllocationStatsTests.randomNodeAllocationStats()) |
138 | 137 | ); |
139 | 138 |
|
@@ -161,7 +160,7 @@ public void testDeduplicatesStatsComputations() throws InterruptedException { |
161 | 160 | disableAllocationStatsCache(); |
162 | 161 | final var requestCounter = new AtomicInteger(); |
163 | 162 | final var isExecuting = new AtomicBoolean(); |
164 | | - when(allocationStatsService.stats(argThat(r -> true))).thenAnswer(invocation -> { |
| 163 | + when(allocationStatsService.stats(any())).thenAnswer(invocation -> { |
165 | 164 | try { |
166 | 165 | assertTrue(isExecuting.compareAndSet(false, true)); |
167 | 166 | assertThat(Thread.currentThread().getName(), containsString("[management]")); |
@@ -262,7 +261,7 @@ public void testGetStatsWithCachingEnabled() throws Exception { |
262 | 261 | final Runnable resetExpectedAllocationStats = () -> { |
263 | 262 | final var stats = Map.of(randomIdentifier(), NodeAllocationStatsTests.randomNodeAllocationStats()); |
264 | 263 | allocationStats.set(stats); |
265 | | - when(allocationStatsService.stats(argThat(r -> true))).thenReturn(stats); |
| 264 | + when(allocationStatsService.stats(any())).thenReturn(stats); |
266 | 265 | }; |
267 | 266 |
|
268 | 267 | final CheckedConsumer<ActionListener<Void>, Exception> threadTask = l -> { |
|
0 commit comments