Class ShareConsumerImplTest

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

public class ShareConsumerImplTest extends Object
  • Constructor Details

    • ShareConsumerImplTest

      public ShareConsumerImplTest()
  • Method Details

    • resetAll

      @AfterEach public void resetAll()
    • testSuccessfulStartupShutdown

      @Test public void testSuccessfulStartupShutdown()
    • testInvalidGroupId

      @Test public void testInvalidGroupId()
    • testFailConstructor

      @Test public void testFailConstructor()
    • testWakeupBeforeCallingPoll

      @Test public void testWakeupBeforeCallingPoll()
    • testControlRecordsOnEmptyFetch

      @Test public void testControlRecordsOnEmptyFetch()
    • testWakeupAfterEmptyFetch

      @Test public void testWakeupAfterEmptyFetch()
    • testWakeupAfterNonEmptyFetch

      @Test public void testWakeupAfterNonEmptyFetch()
    • testFailOnClosedConsumer

      @Test public void testFailOnClosedConsumer()
    • testShouldSendOneShareFetchEventPerPoll

      @Test public void testShouldSendOneShareFetchEventPerPoll()
    • testUnsubscribeWithTopicAuthorizationException

      @Test public void testUnsubscribeWithTopicAuthorizationException()
    • testCloseWithInvalidTopicException

      @Test public void testCloseWithInvalidTopicException()
    • testExplicitModeUnacknowledgedRecords

      @Test public void testExplicitModeUnacknowledgedRecords()
    • testExplicitModeRenewAndAcknowledgeOnPoll

      @Test public void testExplicitModeRenewAndAcknowledgeOnPoll()
    • testCloseWithTopicAuthorizationException

      @Test public void testCloseWithTopicAuthorizationException()
    • testStopFindCoordinatorOnClose

      @Test public void testStopFindCoordinatorOnClose()
    • testVerifyApplicationEventOnShutdown

      @Test public void testVerifyApplicationEventOnShutdown()
    • testAcknowledgementCommitCallbackRegistrationEvent

      @Test public void testAcknowledgementCommitCallbackRegistrationEvent()
    • testAcknowledgementCommitCallbackRegistrationEvent_Null

      @Test public void testAcknowledgementCommitCallbackRegistrationEvent_Null()
    • testCompleteQuietly

      @Test public void testCompleteQuietly()
    • testSubscribeGeneratesEvent

      @Test public void testSubscribeGeneratesEvent()
    • testUnsubscribeGeneratesUnsubscribeEvent

      @Test public void testUnsubscribeGeneratesUnsubscribeEvent()
    • testSubscribeToEmptyListActsAsUnsubscribe

      @Test public void testSubscribeToEmptyListActsAsUnsubscribe()
    • testSubscribeToNullTopicCollection

      @Test public void testSubscribeToNullTopicCollection()
    • testSubscriptionOnNullTopic

      @Test public void testSubscriptionOnNullTopic()
    • testSubscriptionOnEmptyTopic

      @Test public void testSubscriptionOnEmptyTopic()
    • testBackgroundError

      @Test public void testBackgroundError()
    • testMultipleBackgroundErrors

      @Test public void testMultipleBackgroundErrors()
    • testGroupIdNull

      @Test public void testGroupIdNull()
    • testGroupIdEmpty

      @Test public void testGroupIdEmpty()
    • testGroupIdOnlyWhitespaces

      @Test public void testGroupIdOnlyWhitespaces()
    • testEnsurePollEventSentOnConsumerPoll

      @Test public void testEnsurePollEventSentOnConsumerPoll()
    • testPollDoesNotAddNewSharePollEventWhenOneIsAlreadyInFlight

      @Test public void testPollDoesNotAddNewSharePollEventWhenOneIsAlreadyInFlight()
    • testCloseWithBackgroundQueueErrorsAfterUnsubscribe

      @ParameterizedTest @EnumSource(value=org.apache.kafka.common.protocol.Errors.class, names={"TOPIC_AUTHORIZATION_FAILED","GROUP_AUTHORIZATION_FAILED","INVALID_TOPIC_EXCEPTION"}) public void testCloseWithBackgroundQueueErrorsAfterUnsubscribe(org.apache.kafka.common.protocol.Errors error)
    • testProcessBackgroundEventsWithInitialDelay

      @Test public void testProcessBackgroundEventsWithInitialDelay() throws Exception
      Tests processBackgroundEvents handles the case where the Future takes a bit of time to complete, but does within the timeout.
      Throws:
      Exception
    • testProcessBackgroundEventsWithoutDelay

      @Test public void testProcessBackgroundEventsWithoutDelay()
      Tests processBackgroundEvents handles the case where the Future is already complete when invoked, so it doesn't have to wait.
    • testRecordBackgroundEventQueueSize

      @Test public void testRecordBackgroundEventQueueSize()
    • testProcessBackgroundEventsTimesOut

      @Test public void testProcessBackgroundEventsTimesOut() throws Exception
      Tests processBackgroundEvents handles the case where the Future does not complete within the timeout.
      Throws:
      Exception
    • testMetricsRemovedOnClose

      @Test public void testMetricsRemovedOnClose()
    • testConstructorFailsOnNetworkClientConstructorFailure

      @Test public void testConstructorFailsOnNetworkClientConstructorFailure()
      This test ensures that the ShareConsumer implementation fails on creation when the underlying NetworkClient fails creation.

      The logic to check for this case is admittedly a bit awkward because the constructor can fail for all manner of reasons. So a failure case is created by specifying an invalid LoginModule class name, which in turn causes the NetworkClient to fail.