This commit is contained in:
Looly
2022-01-20 11:41:56 +08:00
parent 7c18710712
commit a6e1231085
3 changed files with 13 additions and 3 deletions

View File

@@ -137,7 +137,8 @@ public class IdUtilTest {
@Test
public void getDataCenterIdTest(){
//按照mac地址算法拼接的算法maxDatacenterId应该是0xffffffffL>>6-1此处暂时按照0x7fffffffffffffffL-1防止最后取模溢出
final long dataCenterId = IdUtil.getDataCenterId(Long.MAX_VALUE);
Assert.assertTrue(dataCenterId > 1);
Assert.assertTrue(dataCenterId >= 0);
}
}