Skip to content

Commit

Permalink
[cleanup] Remove some string utils from commons lang that work the sa…
Browse files Browse the repository at this point in the history
…me in java

under the hood they just make simple calls, so just use java directly
  • Loading branch information
hazendaz committed Jan 2, 2024
1 parent 7291582 commit 2bd927b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/masterthought/cucumber/json/Element.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {

Expand Down Expand Up @@ -106,7 +106,7 @@ public String getType() {
}

public String getDescription() {
return StringUtils.defaultString(description);
return Objects.toString(description, "");
}

public boolean isScenario() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -83,7 +82,7 @@ void generateReport_OnInvalidPath_ThrowsException() {
@Override
public String getWebPage() {
// invalid file path
return StringUtils.EMPTY;
return "";
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
}
Expand Down

0 comments on commit 2bd927b

Please sign in to comment.