diff options
author | Eric Giffon <eric.giffon@sonarsource.com> | 2023-08-22 16:06:36 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-08-23 20:03:05 +0000 |
commit | b7cbd373bbf7c9e639dd7d43f037e02293dfbd49 (patch) | |
tree | 671d7709974b436d9810891ec26bdbba124df128 /server/sonar-db-dao/src/it/java/org/sonar/db | |
parent | cb42788236fc5ad14cdd98e95dfe455d387ca273 (diff) | |
download | sonarqube-b7cbd373bbf7c9e639dd7d43f037e02293dfbd49.tar.gz sonarqube-b7cbd373bbf7c9e639dd7d43f037e02293dfbd49.zip |
Revert "SONAR-7704 Change type of components.created_at to bigint"
This reverts commit 020582bd
Diffstat (limited to 'server/sonar-db-dao/src/it/java/org/sonar/db')
-rw-r--r-- | server/sonar-db-dao/src/it/java/org/sonar/db/component/ComponentDaoIT.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/server/sonar-db-dao/src/it/java/org/sonar/db/component/ComponentDaoIT.java b/server/sonar-db-dao/src/it/java/org/sonar/db/component/ComponentDaoIT.java index 2131e1b0cef..2299f88c60f 100644 --- a/server/sonar-db-dao/src/it/java/org/sonar/db/component/ComponentDaoIT.java +++ b/server/sonar-db-dao/src/it/java/org/sonar/db/component/ComponentDaoIT.java @@ -24,6 +24,7 @@ import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.util.Arrays; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.Optional; @@ -986,9 +987,9 @@ public class ComponentDaoIT { @Test public void selectByQuery_verify_order() { - Long firstDate = system2.now(); - Long secondDate = system2.now(); - Long thirdDate = system2.now(); + Date firstDate = new Date(system2.now()); + Date secondDate = new Date(system2.now()); + Date thirdDate = new Date(system2.now()); ComponentDto project3 = db.components().insertPrivateProject(componentDto -> componentDto.setName("project3").setCreatedAt(thirdDate)).getMainBranchComponent(); ComponentDto project1 = db.components().insertPrivateProject(componentDto -> componentDto.setName("project1").setCreatedAt(firstDate)).getMainBranchComponent(); @@ -1363,15 +1364,15 @@ public class ComponentDaoIT { @Test public void selectByQuery_filter_created_at() { - ComponentDto project1 = db.components().insertPrivateProject(p -> p.setCreatedAt(parseDate("2018-02-01").getTime())).getMainBranchComponent(); - ComponentDto project2 = db.components().insertPrivateProject(p -> p.setCreatedAt(parseDate("2018-06-01").getTime())).getMainBranchComponent(); + ComponentDto project1 = db.components().insertPrivateProject(p -> p.setCreatedAt(parseDate("2018-02-01"))).getMainBranchComponent(); + ComponentDto project2 = db.components().insertPrivateProject(p -> p.setCreatedAt(parseDate("2018-06-01"))).getMainBranchComponent(); - assertThat(selectProjectUuidsByQuery(q -> q.setCreatedAfter(parseDate("2017-12-01").getTime()))) + assertThat(selectProjectUuidsByQuery(q -> q.setCreatedAfter(parseDate("2017-12-01")))) .containsExactlyInAnyOrder(project1.uuid(), project2.uuid()); - assertThat(selectProjectUuidsByQuery(q -> q.setCreatedAfter(parseDate("2018-02-20").getTime()))) + assertThat(selectProjectUuidsByQuery(q -> q.setCreatedAfter(parseDate("2018-02-20")))) .containsExactlyInAnyOrder(project2.uuid()); - assertThat(selectProjectUuidsByQuery(q -> q.setCreatedAfter(parseDate("2019-01-01").getTime()))) + assertThat(selectProjectUuidsByQuery(q -> q.setCreatedAfter(parseDate("2019-01-01")))) .isEmpty(); } |