diff options
author | Zipeng WU <zipeng.wu@sonarsource.com> | 2023-10-18 10:28:31 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-10-18 20:03:04 +0000 |
commit | c250a3fe5e458fadddb38d22f558c8a2882fa6dd (patch) | |
tree | 67f07ef3602f7114e74dcd0097428eb78f4efa87 | |
parent | 5d05ac7a232282c285d8b04baf37d6259328fae2 (diff) | |
download | sonarqube-c250a3fe5e458fadddb38d22f558c8a2882fa6dd.tar.gz sonarqube-c250a3fe5e458fadddb38d22f558c8a2882fa6dd.zip |
SONAR-20792 Fix flaky ShowActionIT.show_project_setting test
-rw-r--r-- | server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java index 390e3fd007d..b2874ce70a5 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java @@ -131,13 +131,11 @@ public class ShowActionIT { public void show_project_setting() { ProjectDto project = db.components().insertPublicProject().getProjectDto(); logInAsProjectAdministrator(project); - var currentTime = System.currentTimeMillis(); - tester.insert(new NewCodePeriodDto() + var ncd = tester.insert(new NewCodePeriodDto() .setProjectUuid(project.getUuid()) .setType(NewCodePeriodType.NUMBER_OF_DAYS) .setPreviousNonCompliantValue("100") - .setUpdatedAt(currentTime) .setValue("90")); ShowWSResponse response = ws.newRequest() @@ -145,7 +143,7 @@ public class ShowActionIT { .executeProtobuf(ShowWSResponse.class); assertResponse(response, project.getKey(), "", NUMBER_OF_DAYS, "90", false, "100"); - assertUpdatedAt(response, currentTime); + assertUpdatedAt(response, ncd.getUpdatedAt()); } @Test |