@@ -0,0 +1,2727 @@
+/*%0A *  Copyright 1999-2018 Alibaba Group Holding Ltd.%0A *%0A *  Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *  you may not use this file except in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *       http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A */%0Apackage com.alibaba.fescar.core.protocol.transaction;%0A%0Aimport com.alibaba.fescar.core.protocol.ResultCode;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.nio.ByteBuffer;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0A/**%0A * A unit test for %7B@link GlobalBeginResponse%7D%0A *%0A * @author liujc%0A * @date 2019/3/22 11:09%0A **/%0Apublic class GlobalBeginResponseTest %7B%0A    private final String XID = %22test_xid%22;%0A    private final String EXTRA_DATA = %22test_extra_data%22;%0A    private final ResultCode RESULT_CODE = ResultCode.Success;%0A%0A    @Test%0A    public void testGetSetXid() %7B%0A        GlobalBeginResponse globalBeginResponse = new GlobalBeginResponse();%0A        globalBeginResponse.setXid(XID);%0A        Assert.assertEquals(XID, globalBeginResponse.getXid());%0A    %7D%0A%0A    @Test%0A    public void testGetSetExtraData() %7B%0A        GlobalBeginResponse globalBeginResponse = new GlobalBeginResponse();%0A        globalBeginResponse.setExtraData(EXTRA_DATA);%0A        Assert.assertEquals(EXTRA_DATA, globalBeginResponse.getExtraData());%0A    %7D%0A%0A    @Test%0A    public void testGetTypeCode() %7B%0A        GlobalBeginResponse globalBeginResponse = new GlobalBeginResponse();%0A        Assert.assertEquals(GlobalBeginResponse.TYPE_GLOBAL_BEGIN_RESULT, globalBeginResponse.getTypeCode());%0A    %7D%0A%0A    @Test%0A    public void testDoEncodeAndDecode() %7B%0A        GlobalBeginResponse globalBeginResponseOne = new GlobalBeginResponse();%0A        globalBeginResponseOne.setXid(XID);%0A        globalBeginResponseOne.setExtraData(EXTRA_DATA);%0A        globalBeginResponseOne.setResultCode(RESULT_CODE);%0A        byte%5B%5D encode = globalBeginResponseOne.encode();%0A        GlobalBeginResponse globalBeginResponseTwo = new GlobalBeginResponse();%0A        globalBeginResponseTwo.decode(ByteBuffer.wrap(encode));%0A        assertThat(globalBeginResponseOne.getXid()).isEqualTo(globalBeginResponseTwo.getXid());%0A        assertThat(globalBeginResponseOne.getExtraData()).isEqualTo(globalBeginResponseTwo.getExtraData());%0A        assertThat(globalBeginResponseOne.getResultCode()).isEqualTo(globalBeginResponseTwo.getResultCode());%0A    %7D%0A%7D%0A

Add test case for GlobalBeginResponse (#651)