From f1b446538a23201971cb9f692c0eba44aca9fae4 Mon Sep 17 00:00:00 2001 From: TingyuDong <113588395+TingyuDong@users.noreply.github.com> Date: Tue, 2 Apr 2024 15:16:58 +0800 Subject: [PATCH] ADM-873:[backend] fix: fix test (#1321) * ADM-873:[backend] fix:update test verify * ADM-873:[backend] fix:fix sonar --------- Co-authored-by: yulongcai --- .../service/report/GenerateReporterServiceTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/test/java/heartbeat/service/report/GenerateReporterServiceTest.java b/backend/src/test/java/heartbeat/service/report/GenerateReporterServiceTest.java index 50428c4663..414f3d08a5 100644 --- a/backend/src/test/java/heartbeat/service/report/GenerateReporterServiceTest.java +++ b/backend/src/test/java/heartbeat/service/report/GenerateReporterServiceTest.java @@ -679,7 +679,10 @@ void shouldGenerateCsvWithCachedDataWhenBuildKiteDataAlreadyExisted() { ReportResponse response = responseArgumentCaptor.getValue(); assertEquals(1800000L, response.getExportValidityTime()); assertEquals(fakeLeadTimeForChange, response.getLeadTimeForChanges()); - verify(csvFileGenerator).convertPipelineDataToCSV(eq(pipelineCSVInfos), eq(request.getCsvTimeStamp())); + Awaitility.await() + .atMost(5, TimeUnit.SECONDS) + .untilAsserted(() -> verify(csvFileGenerator).convertPipelineDataToCSV(pipelineCSVInfos, + request.getCsvTimeStamp())); } @Test