Skip to content

Commit

Permalink
[fix][client] Fix breaking changes for the deprecated methods of Topi…
Browse files Browse the repository at this point in the history
…cMessageIdImpl (#20163)
  • Loading branch information
BewareMyPower authored Apr 22, 2023
1 parent e5a833a commit 6036dcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public String getTopicPartitionName() {

@Deprecated
public MessageId getInnerMessageId() {
return new MessageIdImpl(getLedgerId(), getEntryId(), getPartitionIndex());
return msgId;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertSame;

import org.testng.annotations.Test;

Expand Down Expand Up @@ -54,4 +55,12 @@ public void equalsTest() {
assertNotEquals(topicMsgId1, topicMsgId2);
}

@Test
public void testDeprecatedMethods() {
BatchMessageIdImpl msgId = new BatchMessageIdImpl(1, 2, 3, 4);
TopicMessageIdImpl topicMsgId = new TopicMessageIdImpl("topic-partition-0", "topic", msgId);
assertSame(topicMsgId.getInnerMessageId(), msgId);
assertEquals(topicMsgId.getTopicPartitionName(), topicMsgId.getOwnerTopic());
assertEquals(topicMsgId.getTopicName(), "topic");
}
}

0 comments on commit 6036dcc

Please sign in to comment.