Skip to content

Commit

Permalink
Fix UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
RongtongJin committed Aug 28, 2024
1 parent ea0aad2 commit 5c5faf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1838,15 +1838,8 @@ public long searchOffset(final String brokerAddr, final String topicName, final
return this.mqClientInstance.getMQClientAPIImpl().searchOffset(brokerAddr, topicName, queueId, timestamp, timeoutMillis);
}

public QueryResult queryMessageByUniqKey(String topic, String key, int maxNum, long begin,
long end) throws MQClientException, InterruptedException {

return this.mqClientInstance.getMQAdminImpl().queryMessageByUniqKey(null, topic, key, maxNum, begin, end);
}

public QueryResult queryMessageByUniqKey(String clusterName, String topic, String key, int maxNum, long begin,
long end) throws MQClientException, InterruptedException {

return this.mqClientInstance.getMQAdminImpl().queryMessageByUniqKey(clusterName, topic, key, maxNum, begin, end);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.junit.Before;
import org.junit.Test;

import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyString;
Expand Down Expand Up @@ -127,7 +128,8 @@ public void before() throws NoSuchFieldException, IllegalAccessException, Interr
when(mQAdminImpl.queryMessageByUniqKey(anyString(), anyString())).thenReturn(retMsgExt);

QueryResult queryResult = new QueryResult(0, Lists.newArrayList(retMsgExt));
when(defaultMQAdminExtImpl.queryMessageByUniqKey(anyString(), anyString(), anyInt(), anyLong(), anyLong())).thenReturn(queryResult);
when(mQAdminImpl.queryMessageByUniqKey(anyString(), anyString(), anyString(), anyInt(), anyLong(), anyLong())).thenReturn(queryResult);
when(mQAdminImpl.queryMessage(anyString(), anyString(), anyString(), anyInt(), anyLong(), anyLong(), anyBoolean())).thenReturn(queryResult);

TopicRouteData topicRouteData = new TopicRouteData();
List<BrokerData> brokerDataList = new ArrayList<>();
Expand Down

0 comments on commit 5c5faf3

Please sign in to comment.