Skip to content

Commit

Permalink
Update ProcessResourceTest with directory separator
Browse files Browse the repository at this point in the history
  • Loading branch information
fcrespel committed Sep 23, 2022
1 parent 8c791b9 commit a13f3a1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import java.io.File;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
Expand All @@ -29,7 +30,7 @@ void notWindows() {

assertThat(attributes.get(ResourceAttributes.PROCESS_PID)).isGreaterThan(1);
assertThat(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH))
.contains("java")
.contains(File.separatorChar + "java")
.doesNotEndWith(".exe");
assertThat(attributes.get(ResourceAttributes.PROCESS_COMMAND_LINE))
.contains(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH));
Expand All @@ -44,7 +45,7 @@ void windows() {

assertThat(attributes.get(ResourceAttributes.PROCESS_PID)).isGreaterThan(1);
assertThat(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH))
.contains("java")
.contains(File.separatorChar + "java")
.endsWith(".exe");
assertThat(attributes.get(ResourceAttributes.PROCESS_COMMAND_LINE))
.contains(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH));
Expand Down

0 comments on commit a13f3a1

Please sign in to comment.