Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt test to the new ConcurrentTransactionsException heritage #366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,8 @@ public void testKafkaExceptions() {
//test couple of kafka exception
verifyMapperResponse(new CommitFailedException(), Status.INTERNAL_SERVER_ERROR,
KAFKA_ERROR_ERROR_CODE);

Exception cte = new ConcurrentTransactionsException("some message");
// In KAFKA-14417, ConcurrentTransactionsException was changed from an ApiException to be
// a RetriableException (which is itself an ApiException)
// To adapt to this, using if/else logic based on instanceof check so the test can handle the
// ConcurrentTransactionsException being of either heritage
if (cte instanceof RetriableException) {
// After the change KAFKA-14417 ripples thru the builds, this should be the eventual check,
// with the else block looking for KAFKA_ERROR_ERROR_CODE being removed.
verifyMapperResponse(cte, Status.INTERNAL_SERVER_ERROR, KAFKA_RETRIABLE_ERROR_ERROR_CODE);
} else {
verifyMapperResponse(cte, Status.INTERNAL_SERVER_ERROR, KAFKA_ERROR_ERROR_CODE);
}
verifyMapperResponse(new ConcurrentTransactionsException("some message"),
Status.INTERNAL_SERVER_ERROR, KAFKA_RETRIABLE_ERROR_ERROR_CODE);

//test few general exceptions
verifyMapperResponse(new NullPointerException("some message"), Status.INTERNAL_SERVER_ERROR,
Expand Down