This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 35b5b14d92c Refactor CosId's machineId type to int (#22067)
35b5b14d92c is described below

commit 35b5b14d92c95c9e0f35d83cf989e67750f58e0a
Author: Ahoo Wang <[email protected]>
AuthorDate: Sat Nov 12 10:33:50 2022 +0800

    Refactor CosId's machineId type to int (#22067)
    
    * add CosId keygen documentation
    
    * Update String ID Description
    
    * add CosId keygen English-documentation
    
    * Refactor machineId type to int
    
    * Fix unit test regarding MachineId assertion
---
 features/sharding/plugin/cosid/pom.xml                              | 2 +-
 .../algorithm/keygen/CosIdSnowflakeKeyGenerateAlgorithmTest.java    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/features/sharding/plugin/cosid/pom.xml 
b/features/sharding/plugin/cosid/pom.xml
index c4fc9f753cb..c999fa22473 100644
--- a/features/sharding/plugin/cosid/pom.xml
+++ b/features/sharding/plugin/cosid/pom.xml
@@ -28,7 +28,7 @@
     <name>${project.artifactId}</name>
     
     <properties>
-        <cosid.version>1.14.4</cosid.version>
+        <cosid.version>1.16.0</cosid.version>
     </properties>
     
     <dependencies>
diff --git 
a/features/sharding/plugin/cosid/src/test/java/org/apache/shardingsphere/sharding/cosid/algorithm/keygen/CosIdSnowflakeKeyGenerateAlgorithmTest.java
 
b/features/sharding/plugin/cosid/src/test/java/org/apache/shardingsphere/sharding/cosid/algorithm/keygen/CosIdSnowflakeKeyGenerateAlgorithmTest.java
index 1a67887f2d8..712a4503356 100644
--- 
a/features/sharding/plugin/cosid/src/test/java/org/apache/shardingsphere/sharding/cosid/algorithm/keygen/CosIdSnowflakeKeyGenerateAlgorithmTest.java
+++ 
b/features/sharding/plugin/cosid/src/test/java/org/apache/shardingsphere/sharding/cosid/algorithm/keygen/CosIdSnowflakeKeyGenerateAlgorithmTest.java
@@ -65,9 +65,9 @@ public final class CosIdSnowflakeKeyGenerateAlgorithmTest {
         long secondActualKey = (Long) algorithm.generateKey();
         SnowflakeIdState firstActualState = 
snowflakeIdStateParser.parse(firstActualKey);
         SnowflakeIdState secondActualState = 
snowflakeIdStateParser.parse(secondActualKey);
-        assertThat(firstActualState.getMachineId(), is((long) 
FIXTURE_WORKER_ID));
+        assertThat(firstActualState.getMachineId(), is(FIXTURE_WORKER_ID));
         assertThat(firstActualState.getSequence(), is(1L));
-        assertThat(secondActualState.getMachineId(), is((long) 
FIXTURE_WORKER_ID));
+        assertThat(secondActualState.getMachineId(), is(FIXTURE_WORKER_ID));
         long expectedSecondSequence = 2L;
         assertThat(secondActualState.getSequence(), 
is(expectedSecondSequence));
     }
@@ -128,7 +128,7 @@ public final class CosIdSnowflakeKeyGenerateAlgorithmTest {
         assertThat(actualStringKey.length(), 
is(Radix62IdConverter.MAX_CHAR_SIZE));
         long actualLongKey = 
Radix62IdConverter.PAD_START.asLong(actualStringKey);
         SnowflakeIdState actualState = 
snowflakeIdStateParser.parse(actualLongKey);
-        assertThat(actualState.getMachineId(), is((long) FIXTURE_WORKER_ID));
+        assertThat(actualState.getMachineId(), is(FIXTURE_WORKER_ID));
         assertThat(actualState.getSequence(), is(1L));
     }
     

Reply via email to