Class ShareConsumerImplTest
java.lang.Object
org.apache.kafka.clients.consumer.internals.ShareConsumerImplTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidresetAll()voidvoidvoidvoidtestCloseWithBackgroundQueueErrorsAfterUnsubscribe(org.apache.kafka.common.protocol.Errors error) voidvoidvoidvoidThis test ensures that theShareConsumerimplementation fails on creation when the underlyingNetworkClientfails creation.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTestsprocessBackgroundEventshandles the case where theFuturedoes not complete within the timeout.voidTestsprocessBackgroundEventshandles the case where theFuturetakes a bit of time to complete, but does within the timeout.voidTestsprocessBackgroundEventshandles the case where theFutureis already complete when invoked, so it doesn't have to wait.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoid
-
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() -
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() -
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
-
testProcessBackgroundEventsWithoutDelay
@Test public void testProcessBackgroundEventsWithoutDelay()TestsprocessBackgroundEventshandles the case where theFutureis already complete when invoked, so it doesn't have to wait. -
testRecordBackgroundEventQueueSize
@Test public void testRecordBackgroundEventQueueSize() -
testProcessBackgroundEventsTimesOut
-
testMetricsRemovedOnClose
@Test public void testMetricsRemovedOnClose() -
testConstructorFailsOnNetworkClientConstructorFailure
@Test public void testConstructorFailsOnNetworkClientConstructorFailure()This test ensures that theShareConsumerimplementation fails on creation when the underlyingNetworkClientfails 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
LoginModuleclass name, which in turn causes theNetworkClientto fail.
-