We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26dc740 commit e5df1e8Copy full SHA for e5df1e8
hsweb-core/src/test/java/org/hswebframework/web/utils/DigestUtilsTest.java
@@ -0,0 +1,28 @@
1
+package org.hswebframework.web.utils;
2
+
3
+import lombok.SneakyThrows;
4
+import org.junit.Test;
5
6
+import java.util.HashSet;
7
+import java.util.Set;
8
+import java.util.concurrent.ConcurrentHashMap;
9
10
+import static org.junit.Assert.*;
11
12
+public class DigestUtilsTest {
13
14
15
+ @Test
16
+ @SneakyThrows
17
+ public void test() {
18
+ Set<String> check = ConcurrentHashMap.newKeySet();
19
20
+ for (int i = 0; i < 1000; i++) {
21
+ new Thread(() -> check.add(DigestUtils.md5Hex("test")))
22
+ .start();
23
+ }
24
+ Thread.sleep(1000);
25
+ System.out.println(check);
26
+ assertEquals(1, check.size());
27
28
+}
0 commit comments