@Override public String get() { return getKeyWithBranch(); }
@Override public Map<String, String> loadProjectSettings() { return load(scannerProperties.getKeyWithBranch()); }
@Before public void setUp() { MockitoAnnotations.initMocks(this); Map<String, FileData> fileMap = Maps.newHashMap(); project = new SingleProjectRepository(fileMap, new Date()); provider = new ProjectRepositoriesProvider(); when(props.getKeyWithBranch()).thenReturn("key"); }
@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); } }
@Before public void setUp() { MockitoAnnotations.initMocks(this); qualityProfileProvider = new QualityProfilesProvider(); when(props.getKeyWithBranch()).thenReturn("project"); when(projectRepo.exists()).thenReturn(true); response = new ArrayList<>(1); response.add(QualityProfile.newBuilder().setKey("profile").setName("profile").setLanguage("lang").setRulesUpdatedAt(DateUtils.formatDateTime(new Date())).build()); }
public ProjectRepositories provide(ProjectRepositoriesLoader loader, ScannerProperties scannerProperties, GlobalAnalysisMode mode, BranchConfiguration branchConfig) { if (project == null) { boolean isIssuesMode = mode.isIssues(); Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG); project = loader.load(scannerProperties.getKeyWithBranch(), isIssuesMode, branchConfig.longLivingSonarReferenceBranch()); checkProject(isIssuesMode); profiler.stopInfo(); } return project; }
public QualityProfiles provide(QualityProfileLoader loader, ProjectRepositories projectRepositories, ScannerProperties props) { if (this.profiles == null) { List<QualityProfile> profileList; Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG); if (!projectRepositories.exists()) { profileList = loader.loadDefault(getSonarProfile(props)); } else { profileList = loader.load(props.getKeyWithBranch(), getSonarProfile(props)); } profiler.stopInfo(); profiles = new QualityProfiles(profileList); } return profiles; }
@Override public String get() { return getKeyWithBranch(); }
@Override public Map<String, String> loadProjectSettings() { return load(scannerProperties.getKeyWithBranch()); }
public ProjectRepositories provide(ProjectRepositoriesLoader loader, ScannerProperties scannerProperties, GlobalAnalysisMode mode, BranchConfiguration branchConfig) { if (project == null) { boolean isIssuesMode = mode.isIssues(); Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG); project = loader.load(scannerProperties.getKeyWithBranch(), isIssuesMode, branchConfig.longLivingSonarReferenceBranch()); checkProject(isIssuesMode); profiler.stopInfo(); } return project; }
public QualityProfiles provide(QualityProfileLoader loader, ProjectRepositories projectRepositories, ScannerProperties props) { if (this.profiles == null) { List<QualityProfile> profileList; Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG); if (!projectRepositories.exists()) { profileList = loader.loadDefault(getSonarProfile(props)); } else { profileList = loader.load(props.getKeyWithBranch(), getSonarProfile(props)); } profiler.stopInfo(); profiles = new QualityProfiles(profileList); } return profiles; }