Repository: alibaba/fescar (java)

Issue:
About sending renew request to eureka server
- [ ] I have searched the [issues](https://github.com/alibaba/fescar/issues) of this repository and believe that this is not a duplicate.

### Ⅰ. Issue Description
Method "fescar-discovery: EurekaRegistryServiceImpl-getInstanceId()"  builds the instanceId with pattern "%s/%s:%d" (appName, ipaddress, port).
Eureka client(DiscoveryClient-renew()) sends renew request to the url:  myConfigEurekServerAddress/eureka/apps/<appName>/<instanceId>

There is a "/" in instanceId, so the eureka client cannot succeed to renew.

### Ⅱ. Describe what happened

  If there is an exception, please attach the exception trace:

```
Just paste your stack trace here!
```


### Ⅲ. Describe what you expected to happen

renew success.

### Ⅳ. How to reproduce it (as minimally and precisely as possible)

1. xxx
2. xxx
3. xxx

### Ⅴ. Anything else we need to know?


### Ⅵ. Environment:

- JDK version :
- OS :
- Others: my eurke server version is 1.6.2

Pull request:
fix up ,eureka client renew request is error#569
<!-- Please make sure you have read and understood the contributing guidelines -->

### Ⅰ. Describe what this PR did
if user / to splicing instanceId,the renew request will to ***/name/ip:port, but should to ***/(name/ip:port) ,change the instanceId to name:ip:port
add unified the key uppercase,from eureka cluster name is uppercase

### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
fixes #569 

### Ⅲ. Why don't you add test cases (unit test/integration test)? 


### Ⅳ. Describe how to verify it


### Ⅴ. Special notes for reviews



Patch:
diff --git a/README.md b/README.md
index 45f35b749..b6133fb03 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,7 @@ For more details about principle and design, please go to [Fescar wiki page](htt
 
 ## Maven dependency
 ```xml
-<fescar.version>0.2.2</fescar.version>
+<fescar.version>0.3.0</fescar.version>
 
 <dependency>
     <groupId>com.alibaba.fescar</groupId>
diff --git a/common/pom.xml b/common/pom.xml
index f6dd854c9..bdb7b6b2a 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-common</artifactId>
diff --git a/common/src/main/java/com/alibaba/fescar/common/util/NetUtil.java b/common/src/main/java/com/alibaba/fescar/common/util/NetUtil.java
index fd710fd50..a8d5a38fa 100644
--- a/common/src/main/java/com/alibaba/fescar/common/util/NetUtil.java
+++ b/common/src/main/java/com/alibaba/fescar/common/util/NetUtil.java
@@ -202,6 +202,7 @@ public class NetUtil {
             return false;
         }
         String name = address.getHostAddress();
-        return (name != null && !ANY_HOST.equals(name) && !LOCALHOST.equals(name) && IP_PATTERN.matcher(name).matches());
+        return (name != null && !ANY_HOST.equals(name) && !LOCALHOST.equals(name) && IP_PATTERN.matcher(name)
+            .matches());
     }
 }
diff --git a/config/pom.xml b/config/pom.xml
index bdcfb76cd..da22df997 100644
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-config</artifactId>
diff --git a/core/pom.xml b/core/pom.xml
index bb8cd4c79..781236a05 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-core</artifactId>
diff --git a/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java b/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
index 884f5322b..01b54bf4b 100644
--- a/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
+++ b/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
@@ -31,7 +31,7 @@ public class Version {
     /**
      * The constant CURRENT.
      */
-    public static final String CURRENT = "0.3.0";
+    public static final String CURRENT = "0.3.1";
 
     /**
      * The constant VERSION_MAP.
diff --git a/core/src/main/java/com/alibaba/fescar/core/rpc/ChannelManager.java b/core/src/main/java/com/alibaba/fescar/core/rpc/ChannelManager.java
index 47fea51d1..5263f882d 100644
--- a/core/src/main/java/com/alibaba/fescar/core/rpc/ChannelManager.java
+++ b/core/src/main/java/com/alibaba/fescar/core/rpc/ChannelManager.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+
 import com.alibaba.fescar.common.Constants;
 import com.alibaba.fescar.common.exception.FrameworkException;
 import com.alibaba.fescar.common.util.StringUtils;
@@ -30,6 +31,7 @@ import com.alibaba.fescar.core.protocol.RegisterRMRequest;
 import com.alibaba.fescar.core.protocol.RegisterTMRequest;
 import com.alibaba.fescar.core.protocol.Version;
 import com.alibaba.fescar.core.rpc.netty.NettyPoolKey.TransactionRole;
+
 import io.netty.channel.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/discovery/pom.xml b/discovery/pom.xml
index 034830631..089918a3d 100644
--- a/discovery/pom.xml
+++ b/discovery/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <packaging>jar</packaging>
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/EurekaRegistryServiceImpl.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/EurekaRegistryServiceImpl.java
index 6adcdb4bd..b4fb24c6b 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/EurekaRegistryServiceImpl.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/EurekaRegistryServiceImpl.java
@@ -143,7 +143,7 @@ public class EurekaRegistryServiceImpl implements RegistryService<EurekaEventLis
             });
         }
 
-        return Lists.newArrayList(CLUSTER_ADDRESS_MAP.get(clusterName));
+        return Lists.newArrayList(CLUSTER_ADDRESS_MAP.get(clusterName.toUpperCase()));
     }
 
     private static void refreshCluster() {
@@ -226,7 +226,7 @@ public class EurekaRegistryServiceImpl implements RegistryService<EurekaEventLis
     }
 
     private static String getInstanceId() {
-        return String.format("%s/%s:%d", instanceConfig.getAppname(), instanceConfig.getIpAddress(),
+        return String.format("%s:%s:%d", instanceConfig.getAppname(), instanceConfig.getIpAddress(),
             instanceConfig.getNonSecurePort());
     }
 
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java
index 586ede4fb..f4160141a 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/FileRegistryServiceImpl.java
@@ -19,6 +19,7 @@ package com.alibaba.fescar.discovery.registry;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.List;
+
 import com.alibaba.fescar.common.util.StringUtils;
 import com.alibaba.fescar.config.ConfigChangeListener;
 import com.alibaba.fescar.config.Configuration;
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 727fd3d55..3b9d66b71 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-distribution</artifactId>
diff --git a/dubbo-alibaba/pom.xml b/dubbo-alibaba/pom.xml
index 62f2224a6..4e575a428 100644
--- a/dubbo-alibaba/pom.xml
+++ b/dubbo-alibaba/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/dubbo/pom.xml b/dubbo/pom.xml
index d925af2a5..a8ecd2215 100644
--- a/dubbo/pom.xml
+++ b/dubbo/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-dubbo</artifactId>
diff --git a/pom.xml b/pom.xml
index e75efa40f..91885b91f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
 
     <groupId>com.alibaba.fescar</groupId>
     <artifactId>fescar-all</artifactId>
-    <version>0.3.0</version>
+    <version>0.3.1-SNAPSHOT</version>
     <modules>
         <module>config</module>
         <module>common</module>
@@ -121,7 +121,7 @@
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <version>2.6.3</version>
+            <version>2.23.4</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/rm-datasource/pom.xml b/rm-datasource/pom.xml
index 3a85e9f51..dd622dfdf 100644
--- a/rm-datasource/pom.xml
+++ b/rm-datasource/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-rm-datasource</artifactId>
diff --git a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/ConnectionContext.java b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/ConnectionContext.java
index 246d97b6b..64465096b 100644
--- a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/ConnectionContext.java
+++ b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/ConnectionContext.java
@@ -45,7 +45,7 @@ public class ConnectionContext {
     /**
      * set whether requires global lock in this connection
      *
-     * @param isGlobalLockRequires
+     * @param isGlobalLockRequire
      */
     void setGlobalLockRequire(boolean isGlobalLockRequire) {
         this.isGlobalLockRequire = isGlobalLockRequire;
@@ -181,7 +181,7 @@ public class ConnectionContext {
         if (lockKeysBuffer.isEmpty()) {
             return null;
         }
-        StringBuffer appender = new StringBuffer();
+        StringBuilder appender = new StringBuilder();
         Iterator<String> iterable = lockKeysBuffer.iterator();
         while (iterable.hasNext()) {
             appender.append(iterable.next());
diff --git a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutor.java b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutor.java
index ea23a15bf..515542871 100644
--- a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutor.java
+++ b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutor.java
@@ -201,15 +201,13 @@ public abstract class BaseTransactionalExecutor<T, S extends Statement> implemen
         StringBuilder sb = new StringBuilder();
         sb.append(rowsIncludingPK.getTableMeta().getTableName());
         sb.append(":");
-
-        boolean flag = false;
+        int filedSequence = 0;
         for (Field field : rowsIncludingPK.pkRows()) {
-            if (flag) {
+            sb.append(field.getValue());
+            filedSequence++;
+            if (filedSequence < rowsIncludingPK.pkRows().size()) {
                 sb.append(",");
-            } else {
-                flag = true;
             }
-            sb.append(field.getValue());
         }
         return sb.toString();
     }
diff --git a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/struct/TableMetaCache.java b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/struct/TableMetaCache.java
index a6d7d4742..fc73ba4ab 100755
--- a/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/struct/TableMetaCache.java
+++ b/rm-datasource/src/main/java/com/alibaba/fescar/rm/datasource/sql/struct/TableMetaCache.java
@@ -23,12 +23,14 @@ import java.sql.SQLException;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
+
 import com.alibaba.druid.pool.DruidDataSource;
+import com.alibaba.druid.util.StringUtils;
 import com.alibaba.fescar.common.exception.ShouldNeverHappenException;
 import com.alibaba.fescar.core.context.RootContext;
 import com.alibaba.fescar.rm.datasource.AbstractConnectionProxy;
 import com.alibaba.fescar.rm.datasource.DataSourceProxy;
-import com.alibaba.druid.util.StringUtils;
+
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
 
diff --git a/server/pom.xml b/server/pom.xml
index f259c057c..349a899f1 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-server</artifactId>
diff --git a/spring/pom.xml b/spring/pom.xml
index da806af48..bad1ed7f6 100644
--- a/spring/pom.xml
+++ b/spring/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-spring</artifactId>
diff --git a/spring/src/main/java/com/alibaba/fescar/spring/annotation/GlobalTransactionScanner.java b/spring/src/main/java/com/alibaba/fescar/spring/annotation/GlobalTransactionScanner.java
index b17a75b9f..205a06ce2 100644
--- a/spring/src/main/java/com/alibaba/fescar/spring/annotation/GlobalTransactionScanner.java
+++ b/spring/src/main/java/com/alibaba/fescar/spring/annotation/GlobalTransactionScanner.java
@@ -20,6 +20,7 @@ import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.HashSet;
 import java.util.Set;
+
 import com.alibaba.fescar.common.exception.NotSupportYetException;
 import com.alibaba.fescar.common.util.StringUtils;
 import com.alibaba.fescar.config.ConfigurationFactory;
@@ -27,6 +28,7 @@ import com.alibaba.fescar.rm.RMClientAT;
 import com.alibaba.fescar.tm.TMClient;
 import com.alibaba.fescar.tm.api.DefaultFailureHandlerImpl;
 import com.alibaba.fescar.tm.api.FailureHandler;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.aop.Advisor;
diff --git a/tm/pom.xml b/tm/pom.xml
index e8c45c08c..afb32e0f5 100644
--- a/tm/pom.xml
+++ b/tm/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-tm</artifactId>


Test patch:
diff --git a/common/src/test/java/com/alibaba/fescar/common/util/StringUtilsTest.java b/common/src/test/java/com/alibaba/fescar/common/util/StringUtilsTest.java
index 7cd96e0e4..bac0fcfe3 100644
--- a/common/src/test/java/com/alibaba/fescar/common/util/StringUtilsTest.java
+++ b/common/src/test/java/com/alibaba/fescar/common/util/StringUtilsTest.java
@@ -19,7 +19,9 @@ package com.alibaba.fescar.common.util;
 import java.io.IOException;
 import java.io.InputStream;
 import java.sql.SQLException;
+
 import javax.sql.rowset.serial.SerialBlob;
+
 import org.junit.Ignore;
 import org.junit.Test;
 
diff --git a/config/src/test/java/com/alibaba/fescar/config/ConfigurationFactoryTest.java b/config/src/test/java/com/alibaba/fescar/config/ConfigurationFactoryTest.java
new file mode 100644
index 000000000..1294c25a6
--- /dev/null
+++ b/config/src/test/java/com/alibaba/fescar/config/ConfigurationFactoryTest.java
@@ -0,0 +1,55 @@
+/*
+ *  Copyright 1999-2018 Alibaba Group Holding Ltd.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.alibaba.fescar.config;
+
+import com.alibaba.fescar.common.exception.NotSupportYetException;
+import org.junit.Test;
+
+import static com.alibaba.fescar.config.ConfigurationFactory.FILE_INSTANCE;
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author Wu
+ * @date 2019/3/9
+ */
+public class ConfigurationFactoryTest {
+    /**
+     * get config type from registry.conf
+     */
+    private final static ConfigType CONFIG_TYPE = ConfigType.getType(
+            FILE_INSTANCE.getConfig(ConfigurationKeys.FILE_ROOT_CONFIG + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
+                    + ConfigurationKeys.FILE_ROOT_TYPE));
+
+    /**
+     * test for getInstance method
+     */
+    @Test
+    public void testGetInstance() {
+        try {
+            Configuration configuration = ConfigurationFactory.getInstance();
+            if (ConfigType.Nacos.equals(CONFIG_TYPE)) {//Nacos case
+                assertThat(configuration).isInstanceOf(NacosConfiguration.class);
+            } else if (ConfigType.Apollo.equals(CONFIG_TYPE)) {//Apollo case
+                assertThat(configuration).isInstanceOf(ApolloConfiguration.class);
+            } else {//File case
+                assertThat(configuration).isInstanceOf(FileConfiguration.class);
+            }
+        } catch (NotSupportYetException e) {
+            //try to get NotSupportYetException
+            assertThat(e).hasMessage("not support register type:" + CONFIG_TYPE);
+        }
+    }
+}
diff --git a/rm-datasource/src/test/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutorTest.java b/rm-datasource/src/test/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutorTest.java
index 108663324..57de4cad9 100644
--- a/rm-datasource/src/test/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutorTest.java
+++ b/rm-datasource/src/test/java/com/alibaba/fescar/rm/datasource/exec/BaseTransactionalExecutorTest.java
@@ -17,15 +17,25 @@
 package com.alibaba.fescar.rm.datasource.exec;
 
 import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.Callable;
 
 import com.alibaba.fescar.rm.GlobalLockTemplate;
 import com.alibaba.fescar.rm.datasource.ConnectionProxy;
 import com.alibaba.fescar.rm.datasource.StatementProxy;
+import com.alibaba.fescar.rm.datasource.sql.struct.Field;
+import com.alibaba.fescar.rm.datasource.sql.struct.TableMeta;
+import com.alibaba.fescar.rm.datasource.sql.struct.TableRecords;
 
 import org.junit.Assert;
 import org.junit.Test;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+
 public class BaseTransactionalExecutorTest {
 
     @SuppressWarnings({"rawtypes", "unchecked"})
@@ -77,4 +87,35 @@ public class BaseTransactionalExecutorTest {
 
     }
 
+    @Test
+    public void testBuildLockKey() {
+        //build expect data
+        String tableName = "test_name";
+        String fieldOne = "field_one";
+        String fieldTwo = "field_two";
+        String split1 = ":";
+        String split2 = ",";
+        String buildLockKeyExpect = tableName + split1 + fieldOne + split2 + fieldTwo;
+        // mock field
+        Field field1 = mock(Field.class);
+        when(field1.getValue()).thenReturn(fieldOne);
+        Field field2 = mock(Field.class);
+        when(field2.getValue()).thenReturn(fieldTwo);
+        List<Field> fieldList = new ArrayList<>();
+        fieldList.add(field1);
+        fieldList.add(field2);
+        // mock tableMeta
+        TableMeta tableMeta = mock(TableMeta.class);
+        when(tableMeta.getTableName()).thenReturn(tableName);
+        // mock tableRecords
+        TableRecords tableRecords = mock(TableRecords.class);
+        when(tableRecords.getTableMeta()).thenReturn(tableMeta);
+        when(tableRecords.pkRows()).thenReturn(fieldList);
+        when(tableRecords.size()).thenReturn(fieldList.size());
+        // mock executor
+        BaseTransactionalExecutor executor = mock(BaseTransactionalExecutor.class);
+        when(executor.buildLockKey(tableRecords)).thenCallRealMethod();
+        assertThat(executor.buildLockKey(tableRecords)).isEqualTo(buildLockKeyExpect);
+    }
+
 }
diff --git a/spring/src/test/java/com/alibaba/fescar/spring/annotation/BusinessProxy.java b/spring/src/test/java/com/alibaba/fescar/spring/annotation/BusinessProxy.java
index 46637e796..0dcff1140 100644
--- a/spring/src/test/java/com/alibaba/fescar/spring/annotation/BusinessProxy.java
+++ b/spring/src/test/java/com/alibaba/fescar/spring/annotation/BusinessProxy.java
@@ -16,12 +16,12 @@
 
 package com.alibaba.fescar.spring.annotation;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class BusinessProxy implements InvocationHandler {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(BusinessProxy.class);
diff --git a/spring/src/test/java/com/alibaba/fescar/spring/annotation/MethodDescTest.java b/spring/src/test/java/com/alibaba/fescar/spring/annotation/MethodDescTest.java
index 8d51e0226..7ec9b3bb0 100644
--- a/spring/src/test/java/com/alibaba/fescar/spring/annotation/MethodDescTest.java
+++ b/spring/src/test/java/com/alibaba/fescar/spring/annotation/MethodDescTest.java
@@ -16,10 +16,11 @@
 
 package com.alibaba.fescar.spring.annotation;
 
-import org.junit.Test;
-
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+
+import org.junit.Test;
+
 import static org.assertj.core.api.Assertions.assertThat;
 
 /**
@@ -28,7 +29,8 @@ import static org.assertj.core.api.Assertions.assertThat;
  */
 public class MethodDescTest {
 
-    private static final GlobalTransactionScanner GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner("global-trans-scanner-test");
+    private static final GlobalTransactionScanner GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner(
+        "global-trans-scanner-test");
     private static Method method = null;
     private static GlobalTransactional transactional = null;
 
@@ -38,7 +40,8 @@ public class MethodDescTest {
     }
 
     @Test
-    public void testGetTransactionAnnotation() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+    public void testGetTransactionAnnotation()
+        throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
         MethodDesc methodDesc = getMethodDesc();
         assertThat(methodDesc.getTransactionAnnotation()).isEqualTo(transactional);
 
@@ -51,7 +54,8 @@ public class MethodDescTest {
     }
 
     @Test
-    public void testSetTransactionAnnotation() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+    public void testSetTransactionAnnotation()
+        throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
         MethodDesc methodDesc = getMethodDesc();
         assertThat(methodDesc.getTransactionAnnotation()).isNotNull();
         methodDesc.setTransactionAnnotation(null);
@@ -66,12 +70,12 @@ public class MethodDescTest {
         assertThat(methodDesc.getMethod()).isNull();
     }
 
-
     private MethodDesc getMethodDesc() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
         //call the private method
-        Method m = GlobalTransactionScanner.class.getDeclaredMethod("makeMethodDesc", GlobalTransactional.class, Method.class);
+        Method m = GlobalTransactionScanner.class.getDeclaredMethod("makeMethodDesc", GlobalTransactional.class,
+            Method.class);
         m.setAccessible(true);
-        return (MethodDesc) m.invoke(GLOBAL_TRANSACTION_SCANNER, transactional, method);
+        return (MethodDesc)m.invoke(GLOBAL_TRANSACTION_SCANNER, transactional, method);
 
     }
 
diff --git a/test/pom.xml b/test/pom.xml
index 34223f0eb..103bdd42d 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.0</version>
+        <version>0.3.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-test</artifactId>