mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add test
This commit is contained in:
parent
12dba92423
commit
bab6ab5a27
@ -5,6 +5,7 @@ import cn.hutool.core.exceptions.UtilException;
|
|||||||
import cn.hutool.core.thread.ConcurrencyTester;
|
import cn.hutool.core.thread.ConcurrencyTester;
|
||||||
import cn.hutool.core.thread.ThreadUtil;
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -66,4 +67,12 @@ public class SnowflakeTest {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getSnowflakeLengthTest(){
|
||||||
|
for (int i = 0; i < 1000; i++) {
|
||||||
|
final long l = IdUtil.getSnowflake(0, 0).nextId();
|
||||||
|
Assert.assertEquals(19, StrUtil.toString(l).length());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user