Skip to content

Commit d21b290

Browse files
committed
Make sure to clean up system properties in tests
1 parent d6ec219 commit d21b290

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/java/com/github/tadayosi/torchserve/client/ConfigurationTest.java

+14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
package com.github.tadayosi.torchserve.client;
22

3+
import org.junit.jupiter.api.AfterEach;
4+
import org.junit.jupiter.api.BeforeEach;
35
import org.junit.jupiter.api.Test;
46

57
import static org.junit.jupiter.api.Assertions.assertEquals;
68
import static org.junit.jupiter.api.Assertions.assertNotNull;
79

810
class ConfigurationTest {
911

12+
@AfterEach
13+
void cleanSystemProperties() {
14+
System.clearProperty("tsc4j.inference.key");
15+
System.clearProperty("tsc4j.inference.address");
16+
System.clearProperty("tsc4j.inference.port");
17+
System.clearProperty("tsc4j.management.key");
18+
System.clearProperty("tsc4j.management.address");
19+
System.clearProperty("tsc4j.management.port");
20+
System.clearProperty("tsc4j.metrics.address");
21+
System.clearProperty("tsc4j.metrics.port");
22+
}
23+
1024
@Test
1125
void testLoad() {
1226
var config = Configuration.load();

0 commit comments

Comments
 (0)