From 94ea3b30c8fded80d7c02e1f4da12c9e5e6092d3 Mon Sep 17 00:00:00 2001 From: Michal Duda Date: Wed, 5 Aug 2020 11:56:21 +0200 Subject: [PATCH] SONAR-13445 fix failure to export project on Oracle and mssql --- .../org/sonar/db/ce/CeActivityDaoTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java index 79bf805add8..d53912a6779 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java @@ -72,13 +72,13 @@ public class CeActivityDaoTest { private static final long INITIAL_TIME = 1_450_000_000_000L; - private TestSystem2 system2 = new TestSystem2().setNow(INITIAL_TIME); + private final TestSystem2 system2 = new TestSystem2().setNow(INITIAL_TIME); @Rule public DbTester db = DbTester.create(system2); - private DbSession dbSession = db.getSession(); - private CeActivityDao underTest = new CeActivityDao(system2); + private final DbSession dbSession = db.getSession(); + private final CeActivityDao underTest = new CeActivityDao(system2); @Before public void setup() { @@ -768,11 +768,11 @@ public class CeActivityDaoTest { insert("TASK_2", REPORT, MAINCOMPONENT_1, FAILED); ProjectDto projectDto1 = db.components() - .insertPrivateProjectDto(db.getDefaultOrganization(), branchDto -> branchDto.setNeedIssueSync(false)); + .insertPrivateProjectDto(db.getDefaultOrganization(), branchDto -> branchDto.setNeedIssueSync(false)); insert("TASK_3", CeTaskTypes.BRANCH_ISSUE_SYNC, projectDto1.getUuid(), projectDto1.getUuid(), SUCCESS); ProjectDto projectDto2 = db.components() - .insertPrivateProjectDto(db.getDefaultOrganization(), branchDto -> branchDto.setNeedIssueSync(false)); + .insertPrivateProjectDto(db.getDefaultOrganization(), branchDto -> branchDto.setNeedIssueSync(false)); insert("TASK_4", CeTaskTypes.BRANCH_ISSUE_SYNC, projectDto2.getUuid(), projectDto2.getUuid(), SUCCESS); assertThat(underTest.hasAnyFailedIssueSyncTask(db.getSession())).isFalse(); @@ -781,22 +781,22 @@ public class CeActivityDaoTest { insert("TASK_5", CeTaskTypes.BRANCH_ISSUE_SYNC, projectDto3.getUuid(), projectDto3.getUuid(), SUCCESS); BranchDto projectBranch = db.components() - .insertProjectBranch(projectDto3, branchDto -> branchDto.setNeedIssueSync(true)); + .insertProjectBranch(projectDto3, branchDto -> branchDto.setNeedIssueSync(true)); insert("TASK_6", CeTaskTypes.BRANCH_ISSUE_SYNC, projectBranch.getUuid(), projectDto3.getUuid(), FAILED); - //failed task and project branch still exists and need sync + // failed task and project branch still exists and need sync assertThat(underTest.hasAnyFailedIssueSyncTask(db.getSession())).isTrue(); - //assume branch has been re-analysed + // assume branch has been re-analysed db.getDbClient().branchDao().updateNeedIssueSync(db.getSession(), projectBranch.getUuid(), false); assertThat(underTest.hasAnyFailedIssueSyncTask(db.getSession())).isFalse(); - //assume branch has been deleted + // assume branch has been deleted db.getDbClient().purgeDao().deleteBranch(db.getSession(), projectBranch.getUuid()); - //associated branch does not exist, so there is no failures - either it has been deleted or purged or reanalysed + // associated branch does not exist, so there is no failures - either it has been deleted or purged or reanalysed assertThat(underTest.hasAnyFailedIssueSyncTask(db.getSession())).isFalse(); } -- 2.39.5