Skip to content

Commit c8abe42

Browse files
committed
feat(environment): Add more tests
1 parent 29964b3 commit c8abe42

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

components/environment/src/test/java/datadog/environment/SystemPropertiesTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package datadog.environment;
22

33
import static org.junit.jupiter.api.Assertions.*;
4+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
45

56
import org.junit.jupiter.api.Test;
67

@@ -24,4 +25,14 @@ void testGetOrDefault() {
2425

2526
assertThrows(NullPointerException.class, () -> SystemProperties.getOrDefault(null, ""));
2627
}
28+
29+
@Test
30+
void testSet() {
31+
String testProperty = "test.property";
32+
String testValue = "test-value";
33+
assumeTrue(SystemProperties.get(testProperty) == null);
34+
35+
assertTrue(SystemProperties.set(testProperty, testValue));
36+
assertEquals(testValue, SystemProperties.get(testProperty));
37+
}
2738
}

0 commit comments

Comments
 (0)