@Test
public void queryBranchTransactionDO() throws SQLException {

    {
        //creata data for test
        BranchTransactionDO branchTransactionDO = new BranchTransactionDO();
        branchTransactionDO.setResourceId("qqqq");
        branchTransactionDO.setXid("abc-123:6789");
        branchTransactionDO.setTransactionId(24234235);
        branchTransactionDO.setBranchId(345465676);
        branchTransactionDO.setBranchType("TCC");
        branchTransactionDO.setResourceGroupId("abc");
        branchTransactionDO.setLockKey("t:1,2,3;t2,4,5,6");
        branchTransactionDO.setResourceGroupId("a");
        branchTransactionDO.setClientId("1.1.1.1");
        branchTransactionDO.setStatus(1);
        branchTransactionDO.setApplicationData("abc=123");
        branchTransactionDO.setResourceGroupId("test");
        boolean ret = logStoreDataBaseDAO.insertBranchTransactionDO(branchTransactionDO);
        Assertions.assertTrue(ret);
    }
    {
        //creata data for test
        BranchTransactionDO branchTransactionDO = new BranchTransactionDO();
        branchTransactionDO.setResourceId("qqqq");
        branchTransactionDO.setXid("abc-123:6789");
        branchTransactionDO.setTransactionId(24234235);
        branchTransactionDO.setBranchId(78563453);
        branchTransactionDO.setBranchType("TCC");
        branchTransactionDO.setResourceGroupId("abc");
        branchTransactionDO.setLockKey("t:6;t2:7");
        branchTransactionDO.setResourceGroupId("a");
        branchTransactionDO.setClientId("1.1.1.1");
        branchTransactionDO.setStatus(1);
        branchTransactionDO.setApplicationData("abc=123");
        branchTransactionDO.setResourceGroupId("test");
        boolean ret = logStoreDataBaseDAO.insertBranchTransactionDO(branchTransactionDO);
        Assertions.assertTrue(ret);
    }
    List<BranchTransactionDO> rets = logStoreDataBaseDAO.queryBranchTransactionDO("abc-123:6789");
    Assertions.assertTrue(CollectionUtils.isNotEmpty(rets));
    Assertions.assertEquals(2, rets.size());
    if(78563453 == rets.get(0).getBranchId() && 345465676 == rets.get(1).getBranchId()){
        Assertions.assertTrue(true);
    }else if(78563453 == rets.get(1).getBranchId() && 345465676 == rets.get(0).getBranchId()){
        Assertions.assertTrue(true);
    }else {
        Assertions.assertTrue(false);
    }
    String delSql = "delete from branch_table where xid= 'abc-123:6789' ";
    Connection conn = null;
    try{
        conn = dataSource.getConnection();
        conn.createStatement().execute(delSql);
    }finally {
        if(conn != null){
            conn.close();
        }
    }
}