Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
reda-alaoui committed Jul 9, 2023
1 parent f4646d4 commit 51d790f
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jenkinsci.plugins.sonargerrit.gerrit;

import static hudson.Functions.checkPermission;
import static org.jenkinsci.plugins.sonargerrit.util.Localization.getLocalized;

import com.cloudbees.plugins.credentials.common.PasswordCredentials;
Expand All @@ -19,10 +18,8 @@
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import hudson.util.Secret;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import javax.servlet.ServletException;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
Expand Down Expand Up @@ -131,9 +128,8 @@ public ListBoxModel doFillHttpCredentialsIdItems(
public FormValidation doTestConnection(
@AncestorInPath Item item,
@QueryParameter("httpCredentialsId") final String httpCredentialsId,
@QueryParameter("serverName") final String serverName)
throws ServletException, IOException {
checkPermission(item, Item.CONFIGURE);
@QueryParameter("serverName") final String serverName) {
item.checkPermission(Item.CONFIGURE);

Check warning on line 132 in src/main/java/org/jenkinsci/plugins/sonargerrit/gerrit/GerritAuthenticationConfig.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 132 is not covered by tests

FormValidation credentialsIdRequiredValidation =
FormValidation.validateRequired(httpCredentialsId);
Expand Down

0 comments on commit 51d790f

Please sign in to comment.