Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Commit 2dafe0a

Browse files
author
巨鹿
committed
format code
1 parent f574754 commit 2dafe0a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

sofa-serverless-runtime/sofa-serverless-common/src/test/java/com/alipay/sofa/serverless/common/util/MultiBizPropertiesTest.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,26 @@
2828
import java.util.concurrent.atomic.AtomicInteger;
2929

3030
public class MultiBizPropertiesTest {
31-
private final String key1 = "test-key-1";
32-
private final String key2 = "test-key-2";
31+
private final String key1 = "test-key-1";
32+
private final String key2 = "test-key-2";
3333

34-
private final String key3 = "test-key-3";
34+
private final String key3 = "test-key-3";
35+
36+
private final String key4 = "test-key-4";
3537
private final String value1 = "test-value-1";
3638
private final String value2 = "test-value-2";
3739

38-
private ClassLoader baseClassLoader;
40+
private ClassLoader baseClassLoader;
3941

4042
@Before
4143
public void before() {
4244
Thread thread = Thread.currentThread();
4345
baseClassLoader = thread.getContextClassLoader();
4446

4547
System.clearProperty(key1);
48+
System.clearProperty(key2);
49+
System.clearProperty(key3);
50+
System.clearProperty(key4);
4651
MultiBizProperties.initSystem(URLClassLoader.class.getName());
4752
}
4853

@@ -154,7 +159,6 @@ public void testStoreAndLoad() throws IOException {
154159
Assert.assertTrue(properties.containsKey(key1));
155160
Assert.assertTrue(properties.contains(value1));
156161

157-
158162
out = new ByteArrayOutputStream();
159163
PrintWriter writer = new PrintWriter(out);
160164
properties.list(writer);
@@ -192,7 +196,7 @@ public void testRead() {
192196
Assert.assertNull(properties.putIfAbsent(key2, value2));
193197

194198
Assert.assertEquals(properties.computeIfAbsent(key3, k -> value1), value1);
199+
Assert.assertEquals(properties.computeIfPresent(key3, (k, v) -> v + value2), value1 + value2);
195200
}
196201

197-
198202
}

0 commit comments

Comments
 (0)