Skip to content

Commit a4a1960

Browse files
committed
Update broken Mockito tests
JAVA-4239
1 parent 7d591c4 commit a4a1960

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

driver-core/src/test/unit/com/mongodb/internal/connection/LoadBalancedClusterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public void synchronousConcurrentTest() throws InterruptedException, ExecutionEx
375375
Duration srvResolutionTime = Duration.ofSeconds(5);
376376
DnsSrvRecordMonitorFactory dnsSrvRecordMonitorFactory = mock(DnsSrvRecordMonitorFactory.class);
377377
when(dnsSrvRecordMonitorFactory.create(eq(srvHostName), eq(clusterSettings.getSrvServiceName()), any())).thenAnswer(
378-
invocation -> new TestDnsSrvRecordMonitor(invocation.getArgument(1)).sleepTime(srvResolutionTime));
378+
invocation -> new TestDnsSrvRecordMonitor(invocation.getArgument(2)).sleepTime(srvResolutionTime));
379379
cluster = new LoadBalancedCluster(new ClusterId(), clusterSettings, serverFactory, dnsSrvRecordMonitorFactory);
380380

381381
int numThreads = 100;
@@ -426,7 +426,7 @@ public void asynchronousConcurrentTest() throws InterruptedException, ExecutionE
426426
AtomicReference<TestDnsSrvRecordMonitor> dnsSrvRecordMonitorReference = new AtomicReference<>();
427427
when(dnsSrvRecordMonitorFactory.create(eq(srvHostName), eq(clusterSettings.getSrvServiceName()), any())).thenAnswer(
428428
invocation -> {
429-
TestDnsSrvRecordMonitor dnsSrvRecordMonitor = new TestDnsSrvRecordMonitor(invocation.getArgument(1))
429+
TestDnsSrvRecordMonitor dnsSrvRecordMonitor = new TestDnsSrvRecordMonitor(invocation.getArgument(2))
430430
.sleepTime(srvResolutionTime);
431431
dnsSrvRecordMonitorReference.set(dnsSrvRecordMonitor);
432432
return dnsSrvRecordMonitor;

0 commit comments

Comments
 (0)