use of org.sonar.db.qualityprofile.RulesProfileDto in project sonarqube by SonarSource.
the class RegisterQualityProfilesNotificationTest method notification_contains_send_start_and_end_date.
@Test
public void notification_contains_send_start_and_end_date() {
String language = newLanguageKey();
RuleDefinitionDto existingRule = db.rules().insert(r -> r.setLanguage(language));
RulesProfileDto dbProfile = insertBuiltInProfile(language);
activateRuleInDb(dbProfile, existingRule, MAJOR);
RuleDefinitionDto newRule = db.rules().insert(r -> r.setLanguage(language));
addPluginProfile(dbProfile, existingRule, newRule);
builtInQProfileRepositoryRule.initialize();
long startDate = RANDOM.nextInt(5000);
long endDate = startDate + RANDOM.nextInt(5000);
when(system2.now()).thenReturn(startDate, endDate);
underTest.start();
verify(builtInQualityProfilesNotification).onChange(any(), eq(startDate), eq(endDate));
}
use of org.sonar.db.qualityprofile.RulesProfileDto in project sonarqube by SonarSource.
the class BuiltInQProfileUpdateImplTest method assertThatProfileIsMarkedAsUpdated.
private void assertThatProfileIsMarkedAsUpdated(RulesProfileDto dto) {
RulesProfileDto reloaded = db.getDbClient().qualityProfileDao().selectBuiltInRuleProfiles(db.getSession()).stream().filter(p -> p.getUuid().equals(dto.getUuid())).findFirst().get();
assertThat(reloaded.getRulesUpdatedAt()).isNotEmpty();
}
Aggregations