diff --git a/client/src/test/java/org/apache/rocketmq/client/consumer/store/LocalFileOffsetStoreTest.java b/client/src/test/java/org/apache/rocketmq/client/consumer/store/LocalFileOffsetStoreTest.java index 22e212b33634c4086bc02c83da349d60872e0638..a705b30fc3b11480e04e2868ef67de50aa322af9 100644 --- a/client/src/test/java/org/apache/rocketmq/client/consumer/store/LocalFileOffsetStoreTest.java +++ b/client/src/test/java/org/apache/rocketmq/client/consumer/store/LocalFileOffsetStoreTest.java @@ -19,6 +19,8 @@ package org.apache.rocketmq.client.consumer.store; import java.io.File; import java.util.Collections; import java.util.HashSet; +import java.util.Map; + import org.apache.rocketmq.client.ClientConfig; import org.apache.rocketmq.client.impl.factory.MQClientInstance; import org.apache.rocketmq.common.message.MessageQueue; @@ -72,4 +74,15 @@ public class LocalFileOffsetStoreTest { offsetStore.persistAll(new HashSet(Collections.singletonList(messageQueue))); assertThat(offsetStore.readOffset(messageQueue, ReadOffsetType.READ_FROM_STORE)).isEqualTo(1024); } + + @Test + public void testCloneOffset() throws Exception { + OffsetStore offsetStore = new LocalFileOffsetStore(mQClientFactory, group); + MessageQueue messageQueue = new MessageQueue(topic, brokerName, 3); + offsetStore.updateOffset(messageQueue, 1024, false); + Map cloneOffsetTable = offsetStore.cloneOffsetTable(topic); + + assertThat(cloneOffsetTable.size()).isEqualTo(1); + assertThat(cloneOffsetTable.get(messageQueue)).isEqualTo(1024); + } } \ No newline at end of file