@Test void should_activate_hotspots_when_supported() { JavaSonarWayProfile profileDef = new JavaSonarWayProfile(); BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context(); profileDef.define(context); BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("java", "Sonar way"); BuiltInQualityProfilesDefinition.BuiltInActiveRule rule = profile.rule(RuleKey.of("java", "S2092")); assertThat(rule).isNotNull(); }
@Override public void define(Context context) { NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile("Sonar way", Java.KEY); sonarWay.activateRule("common-" + Java.KEY, "DuplicatedBlocks"); Profile jsonProfile = readProfile(); Map<String, String> keys = legacyKeys(); for (String key : jsonProfile.ruleKeys) { sonarWay.activateRule(CheckList.REPOSITORY_KEY, keys.get(key)); } getSecurityRuleKeys(isSonarSecurityBefore78()).forEach(key -> sonarWay.activateRule(key.repository(), key.rule())); sonarWay.done(); }
JavaSonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile("Sonar way", Java.KEY); sonarWay.activateRule("common-" + Java.KEY, "DuplicatedBlocks"); Profile jsonProfile = readProfile(); Map<String, String> keys = legacyKeys(); for (String key : jsonProfile.ruleKeys) { sonarWay.activateRule(CheckList.REPOSITORY_KEY, keys.get(key)); } getSecurityRuleKeys(isSonarSecurityBefore78()).forEach(key -> sonarWay.activateRule(key.repository(), key.rule())); sonarWay.done(); } }
JavaSonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile("Sonar way", Java.KEY); sonarWay.activateRule("common-" + Java.KEY, "DuplicatedBlocks"); Profile jsonProfile = readProfile(); Map<String, String> keys = legacyKeys(); for (String key : jsonProfile.ruleKeys) { sonarWay.activateRule(CheckList.REPOSITORY_KEY, keys.get(key)); } getSecurityRuleKeys(isSonarSecurityBefore78()).forEach(key -> sonarWay.activateRule(key.repository(), key.rule())); sonarWay.done(); }  }
JavaSonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile("Sonar way", Java.KEY); sonarWay.activateRule("common-" + Java.KEY, "DuplicatedBlocks"); Profile jsonProfile = readProfile(); Map<String, String> keys = legacyKeys(); for (String key : jsonProfile.ruleKeys) { sonarWay.activateRule(CheckList.REPOSITORY_KEY, keys.get(key)); } getSecurityRuleKeys(isSonarSecurityBefore78()).forEach(key -> sonarWay.activateRule(key.repository(), key.rule())); sonarWay.done(); }  @Override void define(Context context); }
JavaSonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile("Sonar way", Java.KEY); sonarWay.activateRule("common-" + Java.KEY, "DuplicatedBlocks"); Profile jsonProfile = readProfile(); Map<String, String> keys = legacyKeys(); for (String key : jsonProfile.ruleKeys) { sonarWay.activateRule(CheckList.REPOSITORY_KEY, keys.get(key)); } getSecurityRuleKeys(isSonarSecurityBefore78()).forEach(key -> sonarWay.activateRule(key.repository(), key.rule())); sonarWay.done(); }  @Override void define(Context context);  }