Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>commons-lang3-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>cloudbees-folder</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import io.jenkins.plugins.folderauth.roles.FolderRole;
import io.jenkins.plugins.folderauth.roles.GlobalRole;
import jenkins.model.Jenkins;
import org.apache.commons.lang.StringUtils;

import javax.annotation.ParametersAreNonnullByDefault;
import java.util.HashSet;
Expand Down Expand Up @@ -119,7 +118,7 @@
* @throws IllegalArgumentException when the {@code sid} is empty
*/
public static void assignSidToGlobalRole(String sid, String roleName) {
if (StringUtils.isBlank(sid)) {
if (sid == null || sid.isBlank()) {

Check warning on line 121 in src/main/java/io/jenkins/plugins/folderauth/FolderAuthorizationStrategyAPI.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 121 is only partially covered, one branch is missing
throw new IllegalArgumentException("Sid should not be blank.");
}

Expand All @@ -144,7 +143,7 @@
* @throws IllegalArgumentException when the {@code sid} is empty
*/
public static void assignSidToAgentRole(String sid, String roleName) {
if (StringUtils.isBlank(sid)) {
if (sid == null || sid.isBlank()) {

Check warning on line 146 in src/main/java/io/jenkins/plugins/folderauth/FolderAuthorizationStrategyAPI.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 146 is only partially covered, 2 branches are missing
throw new IllegalArgumentException("Sid should not be blank.");
}

Expand All @@ -169,7 +168,7 @@
* @throws IllegalArgumentException when the {@code sid} is empty
*/
public static void assignSidToFolderRole(String sid, String roleName) {
if (StringUtils.isBlank(sid)) {
if (sid == null || sid.isBlank()) {

Check warning on line 171 in src/main/java/io/jenkins/plugins/folderauth/FolderAuthorizationStrategyAPI.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 171 is only partially covered, one branch is missing
throw new IllegalArgumentException("Sid should not be blank.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Map;
import java.util.Set;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.htmlunit.HttpMethod;
import org.htmlunit.Page;
import org.htmlunit.WebRequest;
Expand Down