Skip to content

Commit

Permalink
Use StringUtils.isNotBlank for text checking
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Nov 4, 2024
1 parent d5d779a commit 0163c32
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected StartLaunchRQ buildStartLaunchRq(ListenerParameters parameters) {
rq.setAttributes(attributes);
rq.setStartTime(Calendar.getInstance().getTime());
rq.setRerun(parameters.isRerun());
rq.setRerunOf(StringUtils.isEmpty(parameters.getRerunOf()) ? null : parameters.getRerunOf());
rq.setRerunOf(StringUtils.isNotBlank(parameters.getRerunOf()) ? parameters.getRerunOf() : null);
return rq;
}

Expand Down Expand Up @@ -604,7 +604,7 @@ private static String getCodeRef(@Nonnull final Method method) {
}

private static String appendSuffixIfNotEmpty(final String str, @Nonnull final String suffix) {
return str + (suffix.isEmpty() ? "" : "$" + suffix);
return str + (StringUtils.isNotBlank(suffix) ? "$" + suffix : "");
}

@Nonnull
Expand Down Expand Up @@ -765,7 +765,9 @@ protected FinishTestItemRQ buildFinishTestRq(@Nonnull ExtensionContext context,
if (myStatus != ItemStatus.PASSED && myException.isPresent()) {
String stepDescription = createStepDescription(context, STEP);
String stackTrace = String.format(DESCRIPTION_TEST_ERROR_FORMAT, getStackTrace(myException.get(), new Throwable()));
String description = !stepDescription.trim().isEmpty() ? MarkdownUtils.asTwoParts(stepDescription, stackTrace) : stackTrace;
String description = StringUtils.isNotBlank(stepDescription) ?
MarkdownUtils.asTwoParts(stepDescription, stackTrace) :
stackTrace;
rq.setDescription(description);
}
ofNullable(status).ifPresent(s -> rq.setStatus(s.name()));
Expand Down

0 comments on commit 0163c32

Please sign in to comment.