We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b5d01f commit 52eaea6Copy full SHA for 52eaea6
1 file changed
framework/src/test/java/org/tron/core/services/ratelimiter/GlobalRateLimiterTest.java
@@ -0,0 +1,22 @@
1
+package org.tron.core.services.ratelimiter;
2
+
3
+import java.lang.reflect.Field;
4
+import org.junit.Assert;
5
+import org.junit.Test;
6
+import org.tron.core.Constant;
7
+import org.tron.core.config.args.Args;
8
9
+public class GlobalRateLimiterTest {
10
11
+ @Test
12
+ public void testAcquire() throws Exception {
13
+ String[] a = new String[0];
14
+ Args.setParam(a, Constant.TESTNET_CONF);
15
+ RuntimeData runtimeData = new RuntimeData(null);
16
+ Field field = runtimeData.getClass().getDeclaredField("address");
17
+ field.setAccessible(true);
18
+ field.set(runtimeData, "127.0.0.1");
19
+ Assert.assertEquals(runtimeData.getRemoteAddr(), "127.0.0.1");
20
+ GlobalRateLimiter.acquire(runtimeData);
21
+ }
22
+}
0 commit comments