@Test public void test() { Context context = new Context(); SolidityProfile definition = new SolidityProfile(); definition.define(context); BuiltInQualityProfile profile = context.profile(Solidity.KEY, SolidityProfile.SONAR_WAY_PROFILE); assertThat(profile).isNotNull(); List<BuiltInActiveRule> activeRules = profile.rules(); Set<String> ruleKeys = activeRules.stream().map(BuiltInActiveRule::ruleKey).collect(Collectors.toSet()); assertThat(activeRules.size()).isGreaterThan(0); assertThat(ruleKeys).contains("ExternalRule1"); }
@Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(SONAR_WAY_PROFILE, Solidity.KEY); BuiltInQualityProfileJsonLoader.load(profile, SolidityRulesDefinition.REPO_KEY, SONAR_WAY_PROFILE_PATH); profile.setDefault(true); profile.done(); }
SolidityProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(SONAR_WAY_PROFILE, Solidity.KEY); BuiltInQualityProfileJsonLoader.load(profile, SolidityRulesDefinition.REPO_KEY, SONAR_WAY_PROFILE_PATH); profile.setDefault(true); profile.done(); } }
SolidityProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(SONAR_WAY_PROFILE, Solidity.KEY); BuiltInQualityProfileJsonLoader.load(profile, SolidityRulesDefinition.REPO_KEY, SONAR_WAY_PROFILE_PATH); profile.setDefault(true); profile.done(); }  }
SolidityProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(SONAR_WAY_PROFILE, Solidity.KEY); BuiltInQualityProfileJsonLoader.load(profile, SolidityRulesDefinition.REPO_KEY, SONAR_WAY_PROFILE_PATH); profile.setDefault(true); profile.done(); }  @Override void define(Context context); }
SolidityProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(SONAR_WAY_PROFILE, Solidity.KEY); BuiltInQualityProfileJsonLoader.load(profile, SolidityRulesDefinition.REPO_KEY, SONAR_WAY_PROFILE_PATH); profile.setDefault(true); profile.done(); }  @Override void define(Context context); static final String SONAR_WAY_PROFILE; static final String SONAR_WAY_PROFILE_PATH; }