test_class.declarator: context
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ChannelHandlerContext context;
test_class.type: ChannelHandlerContext
test_class.var_name: context
test_class.declarator: byteBuf
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ByteBuf byteBuf;
test_class.type: ByteBuf
test_class.var_name: byteBuf
test_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngineTest.java
test_class.identifier: MySQLPacketCodecEngineTest
test_case.body: @Test
      public void assertDecode() {
          when(byteBuf.markReaderIndex()).thenReturn(byteBuf);
          when(byteBuf.readMediumLE()).thenReturn(50);
          when(byteBuf.readRetainedSlice(51)).thenReturn(byteBuf);
          List<Object> out = new LinkedList<>();
          new MySQLPacketCodecEngine().decode(context, byteBuf, out, 54);
          assertThat(out.size(), is(1));
      }
test_case.class_method_signature: MySQLPacketCodecEngineTest.assertDecode()
test_case.full_signature: @Test public void assertDecode()
test_case.identifier: assertDecode
test_case.invocations: thenReturn when markReaderIndex thenReturn when readMediumLE thenReturn when readRetainedSlice decode assertThat size is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertDecode()
focal_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
focal_class.identifier: MySQLPacketCodecEngine
focal_class.interfaces: implements DatabasePacketCodecEngine<MySQLPacket>
focal_class.class_method_signature: MySQLPacketCodecEngine.isValidHeader(final int readableBytes)
focal_class.full_signature: @Override public boolean isValidHeader(final int readableBytes)
focal_class.identifier: isValidHeader
focal_class.modifiers: @Override public
focal_class.parameters: (final int readableBytes)
focal_class.return: boolean
focal_class.signature: boolean isValidHeader(final int readableBytes)
focal_class.class_method_signature: MySQLPacketCodecEngine.decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)
focal_class.full_signature: @Override public void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)
focal_class.identifier: decode
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)
focal_class.return: void
focal_class.signature: void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)
focal_class.class_method_signature: MySQLPacketCodecEngine.encode(final ChannelHandlerContext context, final MySQLPacket message, final ByteBuf out)
focal_class.full_signature: @Override public void encode(final ChannelHandlerContext context, final MySQLPacket message, final ByteBuf out)
focal_class.identifier: encode
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context, final MySQLPacket message, final ByteBuf out)
focal_class.return: void
focal_class.signature: void encode(final ChannelHandlerContext context, final MySQLPacket message, final ByteBuf out)
focal_class.class_method_signature: MySQLPacketCodecEngine.createPacketPayload(final ByteBuf message)
focal_class.full_signature: @Override public MySQLPacketPayload createPacketPayload(final ByteBuf message)
focal_class.identifier: createPacketPayload
focal_class.modifiers: @Override public
focal_class.parameters: (final ByteBuf message)
focal_class.return: MySQLPacketPayload
focal_class.signature: MySQLPacketPayload createPacketPayload(final ByteBuf message)
focal_method.body: @Override
      public void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes) {
          int payloadLength = in.markReaderIndex().readMediumLE();
          int realPacketLength = payloadLength + MySQLPacket.PAYLOAD_LENGTH + MySQLPacket.SEQUENCE_LENGTH;
          if (readableBytes < realPacketLength) {
              in.resetReaderIndex();
              return;
          }
          out.add(in.readRetainedSlice(payloadLength + MySQLPacket.SEQUENCE_LENGTH));
      }
focal_method.class_method_signature: MySQLPacketCodecEngine.decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)
focal_method.full_signature: @Override public void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)
focal_method.identifier: decode
focal_method.invocations: readMediumLE markReaderIndex resetReaderIndex add readRetainedSlice
focal_method.modifiers: @Override public
focal_method.parameters: (final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)
focal_method.return: void
focal_method.signature: void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out, final int readableBytes)