Skip to content

Commit

Permalink
Remove commons lang (#1813)
Browse files Browse the repository at this point in the history
* remove dep on commons-lang

* spotless

* simplify joinery
  • Loading branch information
breedx-splk committed Apr 19, 2024
1 parent 166d65f commit 4bc2c26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions custom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ dependencies {
testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
testImplementation("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
testImplementation("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
testImplementation("org.apache.commons:commons-lang3:3.14.0")

testImplementation(project(":testing:common"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import io.opentelemetry.sdk.resources.Resource;
import java.util.Arrays;
import java.util.function.BiFunction;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -91,7 +90,7 @@ void truncatesWhenTooLong() {
assertThat(resultCmd.length()).isEqualTo(255);
assertThat(resultCmd.endsWith("...")).isTrue();
var cmdArgs = result.getAttribute(PROCESS_COMMAND_ARGS);
String joinedArgs = StringUtils.joinWith(", ", cmdArgs.toArray());
String joinedArgs = String.join(", ", cmdArgs.toArray(new String[] {}));
assertThat(joinedArgs.length()).isLessThan(255);
assertThat(joinedArgs.endsWith("...")).isTrue();
assertThat(result.getAttribute(stringKey("foo"))).isEqualTo("barfly");
Expand All @@ -117,7 +116,7 @@ void testTruncateThroughSpi() {
assertThat(resultCmd.length()).isEqualTo(255);
assertThat(resultCmd.endsWith("...")).isTrue();
var cmdArgs = result.getAttribute(PROCESS_COMMAND_ARGS);
String joinedArgs = StringUtils.joinWith(", ", cmdArgs.toArray());
String joinedArgs = String.join(", ", cmdArgs.toArray(new String[] {}));
assertThat(joinedArgs.length()).isLessThan(255);
assertThat(joinedArgs.endsWith("...")).isTrue();
assertThat(result.getAttribute(stringKey("foo"))).isEqualTo("barfly");
Expand Down

0 comments on commit 4bc2c26

Please sign in to comment.