test_class.declarator: authenticationHandler = mock(MySQLAuthenticationHandler.class)
test_class.modifier: private final
test_class.original_string: private final MySQLAuthenticationHandler authenticationHandler = mock(MySQLAuthenticationHandler.class);
test_class.type: MySQLAuthenticationHandler
test_class.var_name: authenticationHandler
test_class.declarator: authenticationEngine = new MySQLAuthenticationEngine()
test_class.modifier: private final
test_class.original_string: private final MySQLAuthenticationEngine authenticationEngine = new MySQLAuthenticationEngine();
test_class.type: MySQLAuthenticationEngine
test_class.var_name: authenticationEngine
test_class.declarator: authResponse = {-27, 89, -20, -27, 65, -120, -64, -101, 86, -100, -108, -100, 6, -125, -37, 117, 14, -43, 95, -113}
test_class.modifier: private final
test_class.original_string: private final byte[] authResponse = {-27, 89, -20, -27, 65, -120, -64, -101, 86, -100, -108, -100, 6, -125, -37, 117, 14, -43, 95, -113};
test_class.type: byte[]
test_class.var_name: authResponse
test_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/auth/MySQLAuthenticationEngineTest.java
test_class.identifier: MySQLAuthenticationEngineTest
test_case.body: @Test
      public void assertAuthSwitchResponse() {
          setConnectionPhase(MySQLConnectionPhase.AUTHENTICATION_METHOD_MISMATCH);
          MySQLPacketPayload payload = mock(MySQLPacketPayload.class);
          ChannelHandlerContext channelHandlerContext = mock(ChannelHandlerContext.class);
          when(payload.readStringEOFByBytes()).thenReturn(authResponse);
          setAuthenticationResult();
          authenticationEngine.auth(channelHandlerContext, payload);
          assertThat(getAuthResponse(), is(authResponse));
      }
test_case.class_method_signature: MySQLAuthenticationEngineTest.assertAuthSwitchResponse()
test_case.full_signature: @Test public void assertAuthSwitchResponse()
test_case.identifier: assertAuthSwitchResponse
test_case.invocations: setConnectionPhase mock mock thenReturn when readStringEOFByBytes setAuthenticationResult auth assertThat getAuthResponse is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertAuthSwitchResponse()
focal_class.declarator: authenticationHandler = new MySQLAuthenticationHandler()
focal_class.modifier: private final
focal_class.original_string: private final MySQLAuthenticationHandler authenticationHandler = new MySQLAuthenticationHandler();
focal_class.type: MySQLAuthenticationHandler
focal_class.var_name: authenticationHandler
focal_class.declarator: connectionPhase = MySQLConnectionPhase.INITIAL_HANDSHAKE
focal_class.modifier: private
focal_class.original_string: private MySQLConnectionPhase connectionPhase = MySQLConnectionPhase.INITIAL_HANDSHAKE;
focal_class.type: MySQLConnectionPhase
focal_class.var_name: connectionPhase
focal_class.declarator: sequenceId
focal_class.modifier: private
focal_class.original_string: private int sequenceId;
focal_class.type: int
focal_class.var_name: sequenceId
focal_class.declarator: authResponse
focal_class.modifier: private
focal_class.original_string: private byte[] authResponse;
focal_class.type: byte[]
focal_class.var_name: authResponse
focal_class.declarator: currentAuthResult
focal_class.modifier: private
focal_class.original_string: private AuthenticationResult currentAuthResult;
focal_class.type: AuthenticationResult
focal_class.var_name: currentAuthResult
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/auth/MySQLAuthenticationEngine.java
focal_class.identifier: MySQLAuthenticationEngine
focal_class.interfaces: implements AuthenticationEngine
focal_class.class_method_signature: MySQLAuthenticationEngine.handshake(final ChannelHandlerContext context)
focal_class.full_signature: @Override public int handshake(final ChannelHandlerContext context)
focal_class.identifier: handshake
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context)
focal_class.return: int
focal_class.signature: int handshake(final ChannelHandlerContext context)
focal_class.class_method_signature: MySQLAuthenticationEngine.auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.full_signature: @Override public AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.identifier: auth
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context, final PacketPayload payload)
focal_class.return: AuthenticationResult
focal_class.signature: AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.class_method_signature: MySQLAuthenticationEngine.authPhaseFastPath(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.full_signature: private AuthenticationResult authPhaseFastPath(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.identifier: authPhaseFastPath
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context, final PacketPayload payload)
focal_class.return: AuthenticationResult
focal_class.signature: AuthenticationResult authPhaseFastPath(final ChannelHandlerContext context, final PacketPayload payload)
focal_class.class_method_signature: MySQLAuthenticationEngine.isClientPluginAuth(final MySQLHandshakeResponse41Packet packet)
focal_class.full_signature: private boolean isClientPluginAuth(final MySQLHandshakeResponse41Packet packet)
focal_class.identifier: isClientPluginAuth
focal_class.modifiers: private
focal_class.parameters: (final MySQLHandshakeResponse41Packet packet)
focal_class.return: boolean
focal_class.signature: boolean isClientPluginAuth(final MySQLHandshakeResponse41Packet packet)
focal_class.class_method_signature: MySQLAuthenticationEngine.authenticationMethodMismatch(final MySQLPacketPayload payload)
focal_class.full_signature: private void authenticationMethodMismatch(final MySQLPacketPayload payload)
focal_class.identifier: authenticationMethodMismatch
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: void
focal_class.signature: void authenticationMethodMismatch(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLAuthenticationEngine.createErrorPacket(final MySQLServerErrorCode errorCode, final ChannelHandlerContext context)
focal_class.full_signature: private MySQLErrPacket createErrorPacket(final MySQLServerErrorCode errorCode, final ChannelHandlerContext context)
focal_class.identifier: createErrorPacket
focal_class.modifiers: private
focal_class.parameters: (final MySQLServerErrorCode errorCode, final ChannelHandlerContext context)
focal_class.return: MySQLErrPacket
focal_class.signature: MySQLErrPacket createErrorPacket(final MySQLServerErrorCode errorCode, final ChannelHandlerContext context)
focal_class.class_method_signature: MySQLAuthenticationEngine.getErrorMessage()
focal_class.full_signature: private String getErrorMessage()
focal_class.identifier: getErrorMessage
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getErrorMessage()
focal_class.class_method_signature: MySQLAuthenticationEngine.getHostAddress(final ChannelHandlerContext context)
focal_class.full_signature: private String getHostAddress(final ChannelHandlerContext context)
focal_class.identifier: getHostAddress
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context)
focal_class.return: String
focal_class.signature: String getHostAddress(final ChannelHandlerContext context)
focal_method.body: @Override
      public AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload) {
          if (MySQLConnectionPhase.AUTH_PHASE_FAST_PATH == connectionPhase) {
              currentAuthResult = authPhaseFastPath(context, payload);
              if (!currentAuthResult.isFinished()) {
                  return currentAuthResult;
              }
          } else if (MySQLConnectionPhase.AUTHENTICATION_METHOD_MISMATCH == connectionPhase) {
              authenticationMethodMismatch((MySQLPacketPayload) payload);
          }
          Optional<MySQLServerErrorCode> errorCode = authenticationHandler.login(currentAuthResult.getUsername(), authResponse, currentAuthResult.getDatabase());
          context.writeAndFlush(errorCode.isPresent() ? createErrorPacket(errorCode.get(), context) : new MySQLOKPacket(++sequenceId));
          return AuthenticationResultBuilder.finished(currentAuthResult.getUsername(), currentAuthResult.getDatabase());
      }
focal_method.class_method_signature: MySQLAuthenticationEngine.auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_method.full_signature: @Override public AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)
focal_method.identifier: auth
focal_method.invocations: authPhaseFastPath isFinished authenticationMethodMismatch login getUsername getDatabase writeAndFlush isPresent createErrorPacket get finished getUsername getDatabase
focal_method.modifiers: @Override public
focal_method.parameters: (final ChannelHandlerContext context, final PacketPayload payload)
focal_method.return: AuthenticationResult
focal_method.signature: AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload)