Class FetchBufferTest

java.lang.Object
org.apache.kafka.clients.consumer.internals.FetchBufferTest

public class FetchBufferTest extends Object
This tests the FetchBuffer functionality in addition to what FetcherTest covers in its tests. One of the main concerns of these tests are that we correctly handle both places that data is held internally:
  1. A special "next in line" buffer
  2. The remainder of the buffers in a queue
  • Constructor Details

    • FetchBufferTest

      public FetchBufferTest()
  • Method Details

    • setup

      @BeforeEach public void setup()
    • testBasicPeekAndPoll

      @Test public void testBasicPeekAndPoll()
      Verifies the basics: we can add buffered data to the queue, peek to view them, and poll to remove them.
    • testCloseClearsData

      @Test public void testCloseClearsData()
      Verifies FetchBuffer.close()} closes the buffered data for both the queue and the next-in-line buffer.
    • testBufferedPartitions

      @Test public void testBufferedPartitions()
      Tests that the buffer returns partitions for both the queue and the next-in-line buffer.
    • testAddAllAndRetainAll

      @Test public void testAddAllAndRetainAll()
      Tests that the buffer manipulates partitions for both the queue and the next-in-line buffer.
    • testWakeup

      @Test public void testWakeup() throws Exception
      Throws:
      Exception