From b35e6f956d94c3ff17739e640ce81f39e4660772 Mon Sep 17 00:00:00 2001 From: Parker Date: Tue, 5 Jan 2021 21:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E6=B5=81=E5=99=A8=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/LimiterTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 opsli-modulars/opsli-modulars-system/src/test/java/LimiterTest.java diff --git a/opsli-modulars/opsli-modulars-system/src/test/java/LimiterTest.java b/opsli-modulars/opsli-modulars-system/src/test/java/LimiterTest.java new file mode 100644 index 0000000..23dcb1f --- /dev/null +++ b/opsli-modulars/opsli-modulars-system/src/test/java/LimiterTest.java @@ -0,0 +1,29 @@ +import cn.hutool.http.HttpUtil; +import com.google.common.collect.Maps; +import org.junit.Test; +import org.opsli.common.thread.refuse.AsyncProcessQueueReFuse; + +import java.util.Map; + +/** + * @BelongsProject: think-bboss-parent + * @BelongsPackage: PACKAGE_NAME + * @Author: Parker + * @CreateTime: 2021-01-05 17:17 + * @Description: 限流器测试 + */ +public class LimiterTest { + + @Test + public void test(){ + for (int i = 0; i < 1000; i++) { + AsyncProcessQueueReFuse.execute(()->{ + Map map = Maps.newHashMap(); + map.put("username","demo"); + String ret = HttpUtil.get("http://127.0.0.1:9000/think-bboss-thd/sys/slipCount", map); + System.out.println(ret); + }); + } + } + +}