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() {
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();
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();
}