public LocalIssueTracking(DefaultInputProject project, Tracker<TrackedIssue, ServerIssueFromWs> tracker, ServerLineHashesLoader lastLineHashes, ActiveRules activeRules, ServerIssueRepository serverIssueRepository, ProjectRepositories projectRepositories, DefaultAnalysisMode mode) { this.project = project; this.tracker = tracker; this.lastLineHashes = lastLineHashes; this.serverIssueRepository = serverIssueRepository; this.mode = mode; this.activeRules = activeRules; this.hasServerAnalysis = projectRepositories.lastAnalysisDate() != null; }
private boolean isTherePreviousAnalysis() { return getComponentByType(ProjectRepositories.class).lastAnalysisDate() != null; }
private void checkProject(boolean isIssueMode) { if (isIssueMode) { if (!project.exists()) { LOG.warn("Project doesn't exist on the server. All issues will be marked as 'new'."); } else if (project.lastAnalysisDate() == null) { LOG.warn("No analysis has been found on the server for this project. All issues will be marked as 'new'."); } } } }
@Test public void testAssociated() { when(mode.isIssues()).thenReturn(false); when(loader.load(eq("key"), eq(false), any())).thenReturn(project); ProjectRepositories repo = provider.provide(loader, props, mode, branchConfiguration); assertThat(repo.exists()).isEqualTo(true); assertThat(repo.lastAnalysisDate()).isNotNull(); verify(mode, times(1)).isIssues(); verify(props).getKeyWithBranch(); verify(loader).load(eq("key"), eq(false), eq(null)); verifyNoMoreInteractions(loader, props, mode); } }
public LocalIssueTracking(DefaultInputProject project, Tracker<TrackedIssue, ServerIssueFromWs> tracker, ServerLineHashesLoader lastLineHashes, ActiveRules activeRules, ServerIssueRepository serverIssueRepository, ProjectRepositories projectRepositories, DefaultAnalysisMode mode) { this.project = project; this.tracker = tracker; this.lastLineHashes = lastLineHashes; this.serverIssueRepository = serverIssueRepository; this.mode = mode; this.activeRules = activeRules; this.hasServerAnalysis = projectRepositories.lastAnalysisDate() != null; }
private boolean isTherePreviousAnalysis() { return getComponentByType(ProjectRepositories.class).lastAnalysisDate() != null; }
private void checkProject(boolean isIssueMode) { if (isIssueMode) { if (!project.exists()) { LOG.warn("Project doesn't exist on the server. All issues will be marked as 'new'."); } else if (project.lastAnalysisDate() == null) { LOG.warn("No analysis has been found on the server for this project. All issues will be marked as 'new'."); } } } }