use of org.sonar.server.permission.index.AuthorizationScope in project sonarqube by SonarSource.
the class IssueIndexerTest method test_getAuthorizationScope.
@Test
public void test_getAuthorizationScope() {
AuthorizationScope scope = underTest.getAuthorizationScope();
assertThat(scope.getIndexType().getIndex()).isEqualTo(IssueIndexDefinition.DESCRIPTOR);
assertThat(scope.getIndexType().getType()).isEqualTo(TYPE_AUTHORIZATION);
Predicate<IndexPermissions> projectPredicate = scope.getProjectPredicate();
IndexPermissions project = new IndexPermissions("P1", Qualifiers.PROJECT);
IndexPermissions file = new IndexPermissions("F1", Qualifiers.FILE);
assertThat(projectPredicate.test(project)).isTrue();
assertThat(projectPredicate.test(file)).isFalse();
}
use of org.sonar.server.permission.index.AuthorizationScope in project sonarqube by SonarSource.
the class ProjectMeasuresIndexerTest method test_getAuthorizationScope.
@Test
public void test_getAuthorizationScope() {
AuthorizationScope scope = underTest.getAuthorizationScope();
assertThat(scope.getIndexType().getIndex()).isEqualTo(ProjectMeasuresIndexDefinition.DESCRIPTOR);
assertThat(scope.getIndexType().getType()).isEqualTo(TYPE_AUTHORIZATION);
Predicate<IndexPermissions> projectPredicate = scope.getProjectPredicate();
IndexPermissions project = new IndexPermissions("P1", Qualifiers.PROJECT);
IndexPermissions app = new IndexPermissions("P1", Qualifiers.APP);
IndexPermissions file = new IndexPermissions("F1", Qualifiers.FILE);
assertThat(projectPredicate.test(project)).isTrue();
assertThat(projectPredicate.test(app)).isTrue();
assertThat(projectPredicate.test(file)).isFalse();
}
Aggregations