/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * 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.
 * </p>
 */

package io.shardingsphere.proxy.transport.mysql.packet.handshake;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AuthPluginDataTest {
    
    AuthPluginData authPluginData = new AuthPluginData();
    
    @Test
    public void testGetAuthPluginData() {
        assertEquals(authPluginData.getAuthPluginData().length, 20);
    }
    
    @Test
    public void testGetAuthPluginDataPart1() {
        assertEquals(authPluginData.getAuthPluginDataPart1().length, 8);
    }
    
    @Test
    public void testGetAuthPluginDataPart2() {
        assertEquals(authPluginData.getAuthPluginDataPart2().length, 12);
    }
}

@@ -691,24 +691,136 @@
 ort 
-org.junit.Test;%0A
+com.google.common.primitives.Bytes;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.hamcrest.CoreMatchers.is;
 %0Aimp
@@ -853,22 +853,20 @@
 t.assert
-Equals
+That
 ;%0A%0Apubli
@@ -903,16 +903,24 @@
    %0A    
+private 
 AuthPlug
@@ -926,16 +926,254 @@
 ginData 
+authPluginData;%0A    %0A    private final byte%5B%5D part1 = %7B106, 105, 55, 122, 117, 98, 115, 109%7D;%0A    %0A    private final byte%5B%5D part2 = %7B68, 102, 53, 122, 65, 49, 84, 79, 85, 115, 116, 113%7D;%0A    %0A    @Before%0A    public void setUp() %7B%0A        
 authPlug
@@ -1200,18 +1200,36 @@
 ginData(
-);
+part1, part2);%0A    %7D
 %0A    %0A  
@@ -1284,38 +1284,36 @@
 %7B%0A        assert
-Equals
+That
 (authPluginData.
@@ -1335,19 +1335,40 @@
 ta()
-.length, 20
+, is(Bytes.concat(part1, part2))
 );%0A 
@@ -1440,38 +1440,36 @@
 %7B%0A        assert
-Equals
+That
 (authPluginData.
@@ -1496,18 +1496,19 @@
 t1()
-.length, 8
+, is(part1)
 );%0A 
@@ -1592,14 +1592,12 @@
 sert
-Equals
+That
 (aut
@@ -1636,19 +1636,19 @@
 t2()
-.length, 12
+, is(part2)
 );%0A 

modify all functions.