use of org.sonar.scanner.protocol.input.ProjectRepositories in project sonarqube by SonarSource.
the class ProjectDataLoaderMediumTest method not_returned_secured_settings_when_lgged_but_no_scan_permission.
@Test
public void not_returned_secured_settings_when_lgged_but_no_scan_permission() {
OrganizationDto organizationDto = OrganizationTesting.newOrganizationDto();
dbClient.organizationDao().insert(dbSession, organizationDto);
ComponentDto project = ComponentTesting.newProjectDto(organizationDto);
userSessionRule.logIn("john").addProjectUuidPermissions(UserRole.USER, project.uuid());
dbClient.componentDao().insert(dbSession, project);
addDefaultProfile();
// Project properties
dbClient.propertiesDao().saveProperty(dbSession, new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR").setResourceId(project.getId()));
dbClient.propertiesDao().saveProperty(dbSession, new PropertyDto().setKey("sonar.jira.login.secured").setValue("john").setResourceId(project.getId()));
dbSession.commit();
ProjectRepositories ref = underTest.load(ProjectDataQuery.create().setModuleKey(project.key()).setIssuesMode(true));
Map<String, String> projectSettings = ref.settings(project.key());
assertThat(projectSettings).isEqualTo(ImmutableMap.of("sonar.jira.project.key", "SONAR"));
}
Aggregations