@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);
}