diff --git a/s3stream/src/test/java/com/automq/stream/s3/failover/FailoverTest.java b/s3stream/src/test/java/com/automq/stream/s3/failover/FailoverTest.java index 14b4db1e3b..f73d7c652a 100644 --- a/s3stream/src/test/java/com/automq/stream/s3/failover/FailoverTest.java +++ b/s3stream/src/test/java/com/automq/stream/s3/failover/FailoverTest.java @@ -61,7 +61,8 @@ public void test() throws IOException, ExecutionException, InterruptedException, request.setDevice(path); request.setVolumeId("test_volume_id"); - when(failoverFactory.getWal(any())).thenReturn(BlockWALService.builder(path, 1024 * 1024).nodeId(233).epoch(100).build()); + when(failoverFactory.getWal(any())).thenAnswer(s -> + BlockWALService.builder(path, 1024 * 1024).nodeId(233).epoch(100).build()); boolean exceptionThrown = false; try {