-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move security manager tests to their own suite
- Loading branch information
Showing
8 changed files
with
67 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
47 changes: 47 additions & 0 deletions
47
...yManager/java/io/opentelemetry/instrumentation/resources/SecurityManagerResourceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.resources; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.opentelemetry.api.common.AttributeKey; | ||
import io.opentelemetry.api.common.Attributes; | ||
import io.opentelemetry.sdk.resources.Resource; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.TestInstance; | ||
import org.junit.jupiter.api.condition.EnabledOnJre; | ||
import org.junit.jupiter.api.condition.JRE; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
|
||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | ||
@ExtendWith(SecurityManagerExtension.class) | ||
@EnabledOnJre( | ||
value = {JRE.JAVA_8, JRE.JAVA_11, JRE.JAVA_16}, | ||
disabledReason = "Java 17 deprecates security manager for removal") | ||
class SecurityManagerResourceTest { | ||
|
||
@Test | ||
void hostResourceTestEmpty() { | ||
Attributes attributes = HostResource.buildResource().getAttributes(); | ||
assertThat(attributes.asMap()).containsOnlyKeys(AttributeKey.stringKey("host.name")); | ||
} | ||
|
||
@Test | ||
void osResourceEmpty() { | ||
assertThat(OsResource.buildResource()).isEqualTo(Resource.empty()); | ||
} | ||
|
||
@Test | ||
void processResourceEmpty() { | ||
Attributes attributes = ProcessResource.buildResource().getAttributes(); | ||
assertThat(attributes.asMap()).containsOnlyKeys(AttributeKey.longKey("process.pid")); | ||
} | ||
|
||
@Test | ||
void processRuntimeResourceEmpty() { | ||
assertThat(ProcessRuntimeResource.buildResource()).isEqualTo(Resource.empty()); | ||
} | ||
} |