From 2bd927b8fb5db5d2042e70e8b0fb636c1bf53441 Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Thu, 28 Dec 2023 20:08:22 -0500 Subject: [PATCH] [cleanup] Remove some string utils from commons lang that work the same in java under the hood they just make simple calls, so just use java directly --- src/main/java/net/masterthought/cucumber/json/Element.java | 4 ++-- .../masterthought/cucumber/generators/AbstractPageTest.java | 3 +-- .../cucumber/generators/integrations/PageTest.java | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/masterthought/cucumber/json/Element.java b/src/main/java/net/masterthought/cucumber/json/Element.java index 6468b3e58..c6d774bc0 100644 --- a/src/main/java/net/masterthought/cucumber/json/Element.java +++ b/src/main/java/net/masterthought/cucumber/json/Element.java @@ -1,6 +1,7 @@ package net.masterthought.cucumber.json; import java.time.LocalDateTime; +import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -10,7 +11,6 @@ import net.masterthought.cucumber.json.support.Status; import net.masterthought.cucumber.json.support.StatusCounter; import net.masterthought.cucumber.util.Util; -import org.apache.commons.lang3.StringUtils; public class Element implements Durationable { @@ -106,7 +106,7 @@ public String getType() { } public String getDescription() { - return StringUtils.defaultString(description); + return Objects.toString(description, ""); } public boolean isScenario() { diff --git a/src/test/java/net/masterthought/cucumber/generators/AbstractPageTest.java b/src/test/java/net/masterthought/cucumber/generators/AbstractPageTest.java index 3af98333e..cc1d83755 100644 --- a/src/test/java/net/masterthought/cucumber/generators/AbstractPageTest.java +++ b/src/test/java/net/masterthought/cucumber/generators/AbstractPageTest.java @@ -6,7 +6,6 @@ import java.io.File; import java.util.Properties; -import org.apache.commons.lang3.StringUtils; import org.apache.velocity.VelocityContext; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -83,7 +82,7 @@ void generateReport_OnInvalidPath_ThrowsException() { @Override public String getWebPage() { // invalid file path - return StringUtils.EMPTY; + return ""; } }; diff --git a/src/test/java/net/masterthought/cucumber/generators/integrations/PageTest.java b/src/test/java/net/masterthought/cucumber/generators/integrations/PageTest.java index c22bbb7b9..48d07bc25 100644 --- a/src/test/java/net/masterthought/cucumber/generators/integrations/PageTest.java +++ b/src/test/java/net/masterthought/cucumber/generators/integrations/PageTest.java @@ -13,7 +13,6 @@ import net.masterthought.cucumber.generators.AbstractPage; import net.masterthought.cucumber.generators.integrations.helpers.DocumentAssertion; import net.masterthought.cucumber.json.Output; -import org.apache.commons.lang3.StringUtils; import org.jsoup.Jsoup; /** @@ -27,7 +26,7 @@ protected DocumentAssertion documentFrom(String pageName) { File input = new File(configuration.getReportDirectory(), ReportBuilder.BASE_DIRECTORY + configuration.getDirectorySuffixWithSeparator() + File.separatorChar + pageName); try { - return new DocumentAssertion(Jsoup.parse(input, StandardCharsets.UTF_8.name(), StringUtils.EMPTY)); + return new DocumentAssertion(Jsoup.parse(input, StandardCharsets.UTF_8.name(), "")); } catch (IOException e) { throw new ValidationException(e); }