// edit template rule
// delete template rule
+ public QProfile profile(int id) {
+ QualityProfileDto dto = findNotNull(id);
+ return QProfile.from(dto);
+ }
+
public List<QProfile> allProfiles() {
return search.allProfiles();
}
# GET /profiles/create_form?language=<language>
def create_form
- access_denied unless has_role?(:profileadmin)
require_parameters 'language'
render :partial => 'profiles/create_form', :locals => {:language_key => params[:language]}
end
# GET /profiles/rename_form?id=<id>
def rename_form
- access_denied unless has_role?(:profileadmin)
require_parameters 'id'
- @profile = Profile.find(params[:id])
+ call_backend do
+ @profile = Internal.quality_profiles.profile(params[:id].to_i)
+ end
render :partial => 'profiles/rename_form'
end
qProfiles = new QProfiles(qualityProfileDao, resourceDao, projectService, search, service, rules);
}
+ @Test
+ public void search_profile() throws Exception {
+ QualityProfileDto qualityProfile = new QualityProfileDto().setId(1).setName("Default").setLanguage("java");
+ when(qualityProfileDao.selectById(1)).thenReturn(qualityProfile);
+
+ qProfiles.profile(1);
+ verify(qualityProfileDao).selectById(1);
+ }
+
@Test
public void search_profiles() throws Exception {
qProfiles.allProfiles();