ApexProfile extends ProfileDefinition { @Override public RulesProfile createProfile(ValidationMessages validation) { AnnotationBasedProfileBuilder annotationBasedProfileBuilder = new AnnotationBasedProfileBuilder(ruleFinder); return annotationBasedProfileBuilder.build( CheckList.REPOSITORY_KEY, CheckList.SONAR_WAY_PROFILE, Apex.KEY, CheckList.getChecks(), validation); } ApexProfile(RuleFinder ruleFinder); @Override RulesProfile createProfile(ValidationMessages validation);  }
@Test public void testCreateSonarWayProfile() { ValidationMessages validation = ValidationMessages.create(); RuleFinder ruleFinder = buildRuleFinder(); ApexProfile definition = new ApexProfile(ruleFinder); RulesProfile profile = definition.createProfile(validation); assertThat(profile.getLanguage(), equalTo(Apex.KEY)); assertThat(profile.getName(), equalTo(CheckList.SONAR_WAY_PROFILE)); assertThat(validation.hasErrors(), is(FALSE)); }