@@ -0,0 +1,3052 @@
+package io.shardingsphere.proxy.transport.mysql.packet.handshake;/*%0A * Copyright 2016-2018 shardingsphere.io.%0A * %3Cp%3E%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 * %3C/p%3E%0A */%0A%0Aimport io.netty.buffer.ByteBuf;%0Aimport io.shardingsphere.proxy.transport.mysql.packet.MySQLPacketPayload;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.ArgumentMatchers.anyByte;%0Aimport static org.mockito.ArgumentMatchers.anyInt;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class HandshakeResponse41PacketTest %7B%0A    %0A    private HandshakeResponse41Packet handshakeResponse41Packet;%0A    %0A    @Before%0A    public void setUp() %7B%0A        ByteBuf byteBuf = mock(ByteBuf.class);%0A        byte b = 0;%0A        MySQLPacketPayload payload = new MySQLPacketPayload(byteBuf);%0A        when(byteBuf.readByte()).thenReturn(b);%0A        when(byteBuf.readIntLE()).thenReturn(0);%0A        when(byteBuf.bytesBefore((byte) 0)).thenReturn(0);%0A        when(byteBuf.skipBytes(1)).thenReturn(byteBuf);%0A        when(byteBuf.readBytes(anyByte())).thenReturn(byteBuf);%0A        handshakeResponse41Packet = new HandshakeResponse41Packet(payload);%0A    %7D%0A    %0A    @Test%0A    public void testWrite() %7B%0A        ByteBuf byteBuf = mock(ByteBuf.class);%0A        MySQLPacketPayload payload = new MySQLPacketPayload(byteBuf);%0A        when(byteBuf.writeByte(anyInt())).thenReturn(byteBuf);%0A        when(byteBuf.writeBytes(byteBuf)).thenReturn(byteBuf);%0A    %7D%0A    %0A    @Test%0A    public void testGetSequenceId() %7B%0A        assertThat(handshakeResponse41Packet.getSequenceId(), is(0));%0A    %7D%0A    %0A    @Test%0A    public void testGetCapabilityFlags() %7B%0A        assertThat(handshakeResponse41Packet.getCapabilityFlags(), is(0));%0A    %7D%0A    %0A    @Test%0A    public void testGetMaxPacketSize() %7B%0A        assertThat(handshakeResponse41Packet.getMaxPacketSize(), is(0));%0A    %7D%0A    %0A    @Test%0A    public void testGetCharacterSet() %7B%0A        assertThat(handshakeResponse41Packet.getCharacterSet(), is(0));%0A    %7D%0A    %0A    @Test%0A    public void testGetUsername() %7B%0A        assertThat(handshakeResponse41Packet.getUsername(), is(%22%22));%0A    %7D%0A    %0A    @Test%0A    public void testGetAuthResponse() %7B%0A        byte%5B%5D expected = %7B%7D;%0A        assertThat(handshakeResponse41Packet.getAuthResponse(), is(expected));%0A    %7D%0A    %0A    @Test%0A    public void testGetDatabase() %7B%0A        assertNull(handshakeResponse41Packet.getDatabase());%0A    %7D%0A%7D

add HandshakeResponse41PacketTest.java