Skip to content

Commit

Permalink
isblank fix (#29)
Browse files Browse the repository at this point in the history
Signed-off-by: Maale, Saivarun <[email protected]>
Co-authored-by: Maale, Saivarun <[email protected]>
  • Loading branch information
saivarun0125 and saiva0125 authored Jun 11, 2024
1 parent f15c7f0 commit cf57be9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static CDEventsGlobalConfig get() {
}

private static boolean isNullOrEmpty(String str) {
return str == null || str.trim().isEmpty();
return str.isBlank();

Check warning on line 40 in src/main/java/io/jenkins/plugins/cdevents/CDEventsGlobalConfig.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 40 is not covered by tests
}

public String getSinkType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public static synchronized void rebuildKinesisClient() {
String roleSessionName = "cdevents-plugin";

AmazonKinesisClientBuilder kinesisBuilder = AmazonKinesisClientBuilder.standard();
if (region != null && !region.isEmpty()) {
if (!region.isBlank()) {
kinesisBuilder.withRegion(region);
}
if (endpoint != null && !endpoint.isEmpty()) {
if (!endpoint.isBlank()) {
AwsClientBuilder.EndpointConfiguration endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(
endpoint, region);
kinesisBuilder.withEndpointConfiguration(endpointConfiguration);
}
if (iamRole != null && !iamRole.isEmpty()) {
if (!iamRole.isBlank()) {

Check warning on line 68 in src/main/java/io/jenkins/plugins/cdevents/sinks/KinesisSink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 60-68 are not covered by tests
STSAssumeRoleSessionCredentialsProvider credentialsProvider = new STSAssumeRoleSessionCredentialsProvider.Builder(
iamRole, roleSessionName).build();
kinesisBuilder.withCredentials(credentialsProvider);
Expand Down

0 comments on commit cf57be9

Please sign in to comment.