diff --git a/src/main/java/com/epam/reportportal/junit5/ReportPortalExtension.java b/src/main/java/com/epam/reportportal/junit5/ReportPortalExtension.java index 80066e1..f1d6596 100644 --- a/src/main/java/com/epam/reportportal/junit5/ReportPortalExtension.java +++ b/src/main/java/com/epam/reportportal/junit5/ReportPortalExtension.java @@ -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; } @@ -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 @@ -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()));