Skip to content

Commit

Permalink
ADM-794:[backend]fix: repair test to add sleep (#1018)
Browse files Browse the repository at this point in the history
* ADM-794:[backend]fix: add test for generate report

* ADM-794:[backend]fix: repair test for pipeline

* ADM-794:[backend]fix: add test for pipeline

* ADM-794:[backend]fix: refactor code

* ADM-794:[backend]fix: refactor for report service test

* ADM-794:[backend]fix: repair test to add sleep
  • Loading branch information
yulongcai authored Feb 1, 2024
1 parent 9197e13 commit e41ff49
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void ShouldInitializeMetricsDataCompletedInHandlerWithPreOneWhenPreOneExisted()
}

@Test
void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() {
void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() throws InterruptedException {
MetricsDataCompleted expectMetricsDataResult = MetricsDataCompleted.builder()
.boardMetricsCompleted(false)
.pipelineMetricsCompleted(true)
Expand All @@ -124,6 +124,7 @@ void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() {
.thenReturn(MetricsDataCompleted.builder().pipelineMetricsCompleted(true).build());
doAnswer(invocation -> null).when(generateReporterService).generateBoardReport(request);

Thread.sleep(100);
reportService.generateReportByType(request, MetricType.BOARD);

verify(asyncMetricsDataHandler).putMetricsDataCompleted("csvTimeStamp", expectMetricsDataResult);
Expand Down

0 comments on commit e41ff49

Please sign in to comment.