test_class.declarator: databasePacketCodecEngine
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private DatabasePacketCodecEngine databasePacketCodecEngine;
test_class.type: DatabasePacketCodecEngine
test_class.var_name: databasePacketCodecEngine
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.declarator: packetCodec
test_class.modifier: private
test_class.original_string: private PacketCodec packetCodec;
test_class.type: PacketCodec
test_class.var_name: packetCodec
test_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/test/java/org/apache/shardingsphere/db/protocol/codec/PacketCodecTest.java
test_class.identifier: PacketCodecTest
test_case.body: @Test
      public void assertDecodeWithInvalidHeader() {
          when(byteBuf.readableBytes()).thenReturn(1);
          when(databasePacketCodecEngine.isValidHeader(1)).thenReturn(false);
          packetCodec.decode(context, byteBuf, Collections.emptyList());
          verify(databasePacketCodecEngine, times(0)).decode(context, byteBuf, Collections.emptyList(), 1);
      }
test_case.class_method_signature: PacketCodecTest.assertDecodeWithInvalidHeader()
test_case.full_signature: @Test public void assertDecodeWithInvalidHeader()
test_case.identifier: assertDecodeWithInvalidHeader
test_case.invocations: thenReturn when readableBytes thenReturn when isValidHeader decode emptyList decode verify times emptyList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertDecodeWithInvalidHeader()
focal_class.declarator: databasePacketCodecEngine
focal_class.modifier: private final
focal_class.original_string: private final DatabasePacketCodecEngine databasePacketCodecEngine;
focal_class.type: DatabasePacketCodecEngine
focal_class.var_name: databasePacketCodecEngine
focal_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/codec/PacketCodec.java
focal_class.identifier: PacketCodec
focal_class.class_method_signature: PacketCodec.decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)
focal_class.full_signature: @Override protected void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)
focal_class.identifier: decode
focal_class.modifiers: @Override protected
focal_class.parameters: (final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)
focal_class.return: void
focal_class.signature: void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)
focal_class.class_method_signature: PacketCodec.encode(final ChannelHandlerContext context, final DatabasePacket message, final ByteBuf out)
focal_class.full_signature: @SuppressWarnings("unchecked") @Override protected void encode(final ChannelHandlerContext context, final DatabasePacket message, final ByteBuf out)
focal_class.identifier: encode
focal_class.modifiers: @SuppressWarnings("unchecked") @Override protected
focal_class.parameters: (final ChannelHandlerContext context, final DatabasePacket message, final ByteBuf out)
focal_class.return: void
focal_class.signature: void encode(final ChannelHandlerContext context, final DatabasePacket message, final ByteBuf out)
focal_class.superclass: extends ByteToMessageCodec<DatabasePacket>
focal_method.body: @Override
      protected void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out) {
          int readableBytes = in.readableBytes();
          if (!databasePacketCodecEngine.isValidHeader(readableBytes)) {
              return;
          }
          if (log.isDebugEnabled()) {
              log.debug("Read from client {} : \n {}", context.channel().id().asShortText(), ByteBufUtil.prettyHexDump(in));
          }
          databasePacketCodecEngine.decode(context, in, out, readableBytes);
      }
focal_method.class_method_signature: PacketCodec.decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)
focal_method.full_signature: @Override protected void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)
focal_method.identifier: decode
focal_method.invocations: readableBytes isValidHeader isDebugEnabled debug asShortText id channel prettyHexDump decode
focal_method.modifiers: @Override protected
focal_method.parameters: (final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)
focal_method.return: void
focal_method.signature: void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out)