Skip to content

Commit

Permalink
Update ProcessResourceTest
Browse files Browse the repository at this point in the history
  • Loading branch information
fcrespel committed Sep 24, 2022
1 parent a13f3a1 commit 1ab1e66
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
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,9 +28,7 @@ void notWindows() {
Attributes attributes = resource.getAttributes();

assertThat(attributes.get(ResourceAttributes.PROCESS_PID)).isGreaterThan(1);
assertThat(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH))
.contains(File.separatorChar + "java")
.doesNotEndWith(".exe");
assertThat(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH)).matches(".*[/\\\\]java");
assertThat(attributes.get(ResourceAttributes.PROCESS_COMMAND_LINE))
.contains(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH));
}
Expand All @@ -45,8 +42,7 @@ void windows() {

assertThat(attributes.get(ResourceAttributes.PROCESS_PID)).isGreaterThan(1);
assertThat(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH))
.contains(File.separatorChar + "java")
.endsWith(".exe");
.matches(".*[/\\\\]java\\.exe");
assertThat(attributes.get(ResourceAttributes.PROCESS_COMMAND_LINE))
.contains(attributes.get(ResourceAttributes.PROCESS_EXECUTABLE_PATH));
}
Expand Down

0 comments on commit 1ab1e66

Please sign in to comment.