@Test public void get_profile_by_name_and_language() { QualityProfileDto profileDto = QProfileTesting.newQProfileDto(new QProfileName("xoo", "SonarQube way"), "abcd"); db.qualityProfileDao().insert(dbSession, profileDto); dbSession.commit(); dbSession.clearCache(); assertThat(factory.getByNameAndLanguage("SonarQube way", "xoo").getKey()).isEqualTo("abcd"); assertThat(factory.getByNameAndLanguage("SonarQube way", "java")).isNull(); assertThat(factory.getByNameAndLanguage("Unfound", "xoo")).isNull(); }
private QualityProfileDto createProfile(String lang) { QualityProfileDto profile = QProfileTesting.newQProfileDto(new QProfileName(lang, "P" + lang), "p" + lang); db.qualityProfileDao().insert(session, profile); return profile; }